X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbreak-alignment-interface.cc;h=fdf0afb58aae1822d83ad204512694c71c2956fe;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=c40219b8d23e72fbe5fbfc573da49b231f71bdd6;hpb=6ff19507c8daefce6654bd3067c1eedb6f6ff3f9;p=lilypond.git diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc index c40219b8d2..fdf0afb58a 100644 --- a/lily/break-alignment-interface.cc +++ b/lily/break-alignment-interface.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2007 Han-Wen Nienhuys + (c) 1997--2008 Han-Wen Nienhuys */ @@ -281,7 +281,8 @@ Break_alignable_interface::self_align_callback (SCM grob) { if (elements[i]->get_property ("break-align-symbol") == sym) { - if (Item::break_visible (elements[i])) + if (Item::break_visible (elements[i]) + && !elements[i]->extent (elements[i], X_AXIS).is_empty ()) { break_aligned_grob = i; goto found_break_aligned_grob; /* ugh. need to break out of 2 loops */ @@ -334,8 +335,12 @@ Break_aligned_interface::calc_extent_aligned_anchor (SCM smob) { Grob *me = unsmob_grob (smob); Real alignment = robust_scm2double (me->get_property ("break-align-anchor-alignment"), 0.0); + Interval iv = me->extent (me, X_AXIS); - return scm_from_double (me->extent (me, X_AXIS).linear_combination (alignment)); + if (isinf (iv[LEFT]) && isinf (iv[RIGHT])) /* avoid NaN */ + return scm_from_double (0.0); + + return scm_from_double (iv.linear_combination (alignment)); } MAKE_SCHEME_CALLBACK (Break_aligned_interface, calc_break_visibility, 1) @@ -361,37 +366,38 @@ Break_aligned_interface::calc_break_visibility (SCM smob) } ADD_INTERFACE (Break_alignable_interface, - "Object that is aligned on a break aligment. ", + "Object that is aligned on a break aligment.", /* properties */ "break-align-symbols " - ) - - + ); ADD_INTERFACE (Break_aligned_interface, "Items that are aligned in prefatory matter.\n" "\n" - "The spacing of these items is controlled by the @code{space-alist}\n" - "property. It contains a list @code{break-align-symbol}s with a specification\n" - "of the associated space. The space specification can be " + "The spacing of these items is controlled by the" + " @code{space-alist} property. It contains a list" + " @code{break-align-symbol}s with a specification of the" + " associated space. The space specification can be\n" + "\n" "@table @code\n" "@item (minimum-space . @var{spc}))\n" - " Pad space until the distance is @var{spc}\n" + "Pad space until the distance is @var{spc}.\n" "@item (fixed-space . @var{spc})\n" - " Set a fixed space\n" + "Set a fixed space.\n" "@item (semi-fixed-space . @var{spc})\n" - " Set a space. Half of it is fixed and half is stretchable. \n" - "(does not work at start of line. fixme)\n" + "Set a space. Half of it is fixed and half is stretchable." + " (does not work at start of line. fixme)\n" "@item (extra-space . @var{spc})\n" - " Add @var{spc} amount of space.\n" + "Add @var{spc} amount of space.\n" "@end table\n" "\n" - "Special keys for the alist are @code{first-note} and @code{next-note}, signifying\n" - "the first note on a line, and the next note halfway a line.\n" + "Special keys for the alist are @code{first-note} and" + " @code{next-note}, signifying the first note on a line, and" + " the next note halfway a line.\n" "\n" - "Rules for this spacing are much more complicated than this. \n" - "See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147\n", + "Rules for this spacing are much more complicated than this." + " See [Wanske] page 126--134, [Ross] page 143--147.", /* properties */ "break-align-anchor " @@ -401,8 +407,10 @@ ADD_INTERFACE (Break_aligned_interface, ); ADD_INTERFACE (Break_alignment_interface, - "The object that performs break aligment. See @ref{break-aligned-interface}.", + "The object that performs break aligment. See" + " @ref{break-aligned-interface}.", /* properties */ "positioning-done " - "break-align-orders"); + "break-align-orders " + );