]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix \fill-with-pattern
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 15 May 2011 10:28:51 +0000 (12:28 +0200)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 15 May 2011 10:28:51 +0000 (12:28 +0200)
When the `left' and `right' markups are already wider than the line
width, then the middle filler width shall be forced to null,
iso. being negative.

scm/define-markup-commands.scm

index 125a34339ff726c533fa915d96ad9fa023890a03..3e8953afdf88f2f8e155c2f646dd59648c5d39e5 100644 (file)
@@ -3556,7 +3556,7 @@ Patterns are aligned to the @var{dir} markup.
          (pattern-width (interval-length pattern-x-extent))
          (left-width (interval-length (ly:stencil-extent (interpret-markup layout props left) X)))
          (right-width (interval-length (ly:stencil-extent (interpret-markup layout props right) X)))
-         (middle-width (- line-width (+ (+ left-width right-width) (* word-space 2))))
+         (middle-width (max 0 (- line-width (+ (+ left-width right-width) (* word-space 2)))))
          (period (+ space pattern-width))
          (count (truncate (/ (- middle-width pattern-width) period)))
          (x-offset (+ (* (- (- middle-width (* count period)) pattern-width) (/ (1+ dir) 2)) (abs (car pattern-x-extent)))))