diff options
author | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2008-08-03 23:32:21 -0300 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2008-08-03 23:32:21 -0300 |
commit | 172be3048d8d623922a0cd6bf57f41eedffd05de (patch) | |
tree | 4643ef65df9c0a3133620a4c0fc24c6dfd9b68a9 | |
parent | 061183c4e77fc71e25268f0b815f502cd8a8c48a (diff) |
Add full-length-to-extent property for bug #573.
-rw-r--r-- | input/regression/tuplet-full-length-extent.ly | 20 | ||||
-rw-r--r-- | lily/tuplet-bracket.cc | 9 | ||||
-rw-r--r-- | scm/define-grob-properties.scm | 4 | ||||
-rw-r--r-- | scm/define-grobs.scm | 1 |
4 files changed, 32 insertions, 2 deletions
diff --git a/input/regression/tuplet-full-length-extent.ly b/input/regression/tuplet-full-length-extent.ly new file mode 100644 index 0000000000..e2b1575c9e --- /dev/null +++ b/input/regression/tuplet-full-length-extent.ly @@ -0,0 +1,20 @@ +\header { + + texidoc = "With @code{full-length-to-extent}, the extent of the + attaching column for a full-length tuplet bracket can be ignored." + +} +\version "2.11.55" + +\new Staff { + \set tupletFullLength = ##t + + \time 1/8 + \times 2/3 { c'16 c'16 c'16 } + \times 2/3 { c'16 c'16 c'16 } + \override TupletBracket #'full-length-to-extent = ##f + \times 2/3 { c'16 c'16 c'16 } + \override Score.RehearsalMark #'break-visibility = ##(#t #t #t) + \override Score.RehearsalMark #'direction = #down + \mark "xxxxxxxxxxxxxxxxxxxxxxx" +} diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index f6dea51ba3..639472399c 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -238,7 +238,13 @@ Tuplet_bracket::calc_control_points (SCM smob) if (bounds[d]->break_status_dir ()) padding = 0.0; - x_span[d] = bounds[d]->relative_coordinate(commonx, X_AXIS) - padding; + Real coord = bounds[d]->relative_coordinate(commonx, X_AXIS); + if (to_boolean (me->get_property ("full-length-to-extent"))) + coord = robust_relative_extent(bounds[d], commonx, X_AXIS)[LEFT]; + + coord = max (coord, x_span[LEFT]); + + x_span[d] = coord - padding; } } while (flip (&d) != LEFT); @@ -780,6 +786,7 @@ ADD_INTERFACE (Tuplet_bracket, "edge-height " "edge-text " "full-length-padding " + "full-length-to-extent " "gap " "positions " "note-columns " diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index aef125d32c..b48cbc25fc 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -290,11 +290,13 @@ open string indicators. Default value 0.5. @item @code{xo-padding} -- Padding for open and mute indicators from top fret. Default value 0.25. -@end itemize") +@end itemize") ;" ;; ugh: double, change. (full-length-padding ,number? "How much padding to use at the right side of a full-length tuplet bracket.") + (full-length-to-extent ,boolean? "Run to the extent of the column for a full-length tuplet bracket.") + (full-size-change ,boolean? "Don't make a change clef smaller.") (gap ,ly:dimension? "Size of a gap in a variable symbol.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index ab6b270f24..6e90c43403 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -2044,6 +2044,7 @@ (edge-height . (0.7 . 0.7)) (shorten-pair . (-0.2 . -0.2)) (staff-padding . 0.25) + (full-length-to-extent . #t) (direction . ,ly:tuplet-bracket::calc-direction) (positions . ,ly:tuplet-bracket::calc-positions) (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors) |