From 5865bd18e252a6849ce51b6e2c2ab2b4c17149b7 Mon Sep 17 00:00:00 2001 From: hanwen Date: Wed, 1 Jun 2005 14:26:13 +0000 Subject: [PATCH] (is_empty): check dim_ field for is_empty() too. Fixes inf error with added bass notes. --- ChangeLog | 3 +++ lily/stencil-scheme.cc | 2 +- lily/stencil.cc | 6 +++--- scm/define-markup-commands.scm | 9 ++++++--- scm/markup.scm | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12c696f5a9..d39623b8ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-06-01 Han-Wen Nienhuys + * 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. diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 5dc0d9baab..b497f3f9af 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -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).") diff --git a/lily/stencil.cc b/lily/stencil.cc index 714d403638..291fe6ad06 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -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 diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 89f8fee98b..9502c2c89e 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -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 diff --git a/scm/markup.scm b/scm/markup.scm index 3a679b2416..af0d36dc6e 100644 --- a/scm/markup.scm +++ b/scm/markup.scm @@ -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 -- 2.39.5