]> git.donarmstrong.com Git - lilypond.git/commitdiff
(is_empty): check dim_ field for is_empty()
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 1 Jun 2005 14:26:13 +0000 (14:26 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 1 Jun 2005 14:26:13 +0000 (14:26 +0000)
too. Fixes inf error with added bass notes.

ChangeLog
lily/stencil-scheme.cc
lily/stencil.cc
scm/define-markup-commands.scm
scm/markup.scm

index 12c696f5a965e51b44932ac7459b94bfc6f99a38..d39623b8ec8ca324b104100d9400d7266e02b473 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-06-01  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/stencil.cc (is_empty): check dim_ field for is_empty()
+       too. Fixes inf error with added bass notes.
+
        * scripts/lilypond-book.py (do_options): --psfonts doesn't take
        argument anymore.
 
index 5dc0d9baab287f2cd5fbb7e0930b532709c9b34e..b497f3f9af544a7d47a6d8dbc2ceb00f456944cb 100644 (file)
@@ -65,7 +65,7 @@ LY_DEFINE (ly_stencil_expr, "ly:stencil-expr",
   return s->expr ();
 }
 
-LY_DEFINE (ly_stencil_get_extent, "ly:stencil-extent",
+LY_DEFINE (ly_stencil_extent, "ly:stencil-extent",
           2, 0, 0, (SCM stil, SCM axis),
           "Return a pair of numbers signifying the extent of @var{stil} in "
           "@var{axis} direction (0 or 1 for x and y axis respectively).")
index 714d403638ae5d4bb8a8cfaaf32481bb9506f16b..291fe6ad06b63d161691871ab04aaa0a73a2934a 100644 (file)
@@ -56,12 +56,12 @@ Stencil::extent (Axis a) const
   return dim_[a];
 }
 
-/* Hmm... maybe this is not such a good idea ; stuff can be empty,
-   while expr_ == '()  */
 bool
 Stencil::is_empty () const
 {
-  return expr_ == SCM_EOL;
+  return (expr_ == SCM_EOL
+         || dim_[X_AXIS].is_empty ()
+         || dim_[Y_AXIS].is_empty ());
 }
 
 SCM
index 89f8fee98b2548985ca36a29b368151aa0e9703b..9502c2c89e8c1352592717168fa7691bdb386503 100644 (file)
@@ -274,10 +274,13 @@ gsave /ecrm10 findfont
 (def-markup-command (line layout props args) (markup-list?)
   "Put @var{args} in a horizontal line.  The property @code{word-space}
 determines the space between each markup in @var{args}."
+  (let*
+      ((stencils (map (lambda (m) (interpret-markup layout props m)) args))
+       (space    (chain-assoc-get 'word-space props)))
+
   (stack-stencil-line
-   (chain-assoc-get 'word-space props)
-   (remove ly:stencil-empty?
-          (map (lambda (m) (interpret-markup layout props m)) args))))
+   space
+   (remove ly:stencil-empty? stencils))))
 
 (def-markup-command (fromproperty layout props symbol) (symbol?)
   "Read the @var{symbol} from property settings, and produce a stencil
index 3a679b24167d834451d439c4a3f642e6859c7e3d..af0d36dc6ea0071c008e1e0ba0d3a3a7feca7d54 100644 (file)
@@ -439,7 +439,7 @@ eg: ((italic) (raise 4) (bold)), maps the commands on each markup argument, eg:
       
       (if (and (pair? (cdr stencils))
               (ly:stencil? (cadr stencils)))
-          (let* ((tail (stack-stencil-line  space (cdr stencils)))
+          (let* ((tail (stack-stencil-line space (cdr stencils)))
                  (head (car stencils))
                  (xoff (+ space (cdr (ly:stencil-extent head X)))))
             (ly:stencil-add head