From: Han-Wen Nienhuys Date: Fri, 16 Feb 2007 12:49:23 +0000 (+0100) Subject: Fix #299. X-Git-Tag: release/2.10.19-1~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=46dcb81675cdfe88ced43622ff89798cc5cf422d;p=lilypond.git Fix #299. Take minimum for right_point with system->get_bound(RIGHT) X coordinate. Conflicts: lily/lyric-extender.cc --- diff --git a/input/regression/lyric-extender-right-margin.ly b/input/regression/lyric-extender-right-margin.ly new file mode 100644 index 0000000000..5fb01d5682 --- /dev/null +++ b/input/regression/lyric-extender-right-margin.ly @@ -0,0 +1,23 @@ +\version "2.10.19" +\header { + texidoc = "extenders will not protude into the right margin" + } + +\score{ + { + \relative c' { + \override Score.PaperColumn #'keep-inside-line = ##t + c4 d e f ~ | \break + f4 e d c | + } + + \addlyrics { + c d e effffffffffff __ + e d c + } + } + +} +\paper { + ragged-right = ##t +} diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 867a6d83d3..ed69c6c6c5 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -8,7 +8,8 @@ #include "lyric-extender.hh" - +#include "system.hh" +#include "item.hh" #include "warn.hh" #include "lookup.hh" #include "paper-column.hh" @@ -30,6 +31,8 @@ Lyric_extender::print (SCM smob) common = common->common_refpoint (right_text, X_AXIS); common = common->common_refpoint (me->get_bound (RIGHT), X_AXIS); + common = common->common_refpoint (me->get_system (), X_AXIS); + Real sl = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); extract_grob_set (me, "heads", heads); @@ -56,6 +59,8 @@ Lyric_extender::print (SCM smob) Real right_point = left_point + (robust_scm2double (minlen, 0)); + right_point = min (right_point, me->get_system ()->get_bound (RIGHT)->relative_coordinate (common, X_AXIS)); + if (heads.size ()) right_point = max (right_point, heads.back ()->extent (common, X_AXIS)[RIGHT]);