From 0ad4c4c0df570e26cca972402a070a8eead2f46d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 16 May 2006 19:00:39 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 11 +++++++++++ input/regression/hairpin-to-barline.ly | 18 ++++++++++++++++++ lily/dynamic-engraver.cc | 14 ++++++++++++-- lily/hairpin.cc | 2 +- scm/define-context-properties.scm | 2 ++ 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 input/regression/hairpin-to-barline.ly diff --git a/ChangeLog b/ChangeLog index 9788dca989..8cf2bf6eb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,17 @@ 2006-05-16 Han-Wen Nienhuys + * lily/dynamic-engraver.cc (typeset_all): hang ending on + currentCommandColumn. + + * lily/hairpin.cc (print): also add padding for non-neighbor + hairpin bounds. + + * scm/define-context-properties.scm + (all-user-translation-properties): add hairpinToBarline + + * input/regression/hairpin-to-barline.ly: new file. + * lily/context.cc (internal_send_stream_event): thinko fix. * lily/tie.cc (set_default_control_points): robustness fix. diff --git a/input/regression/hairpin-to-barline.ly b/input/regression/hairpin-to-barline.ly new file mode 100644 index 0000000000..db0483b705 --- /dev/null +++ b/input/regression/hairpin-to-barline.ly @@ -0,0 +1,18 @@ +\header { + + texidoc = "By setting @code{hairpinToBarline}, hairpins will stop at +the barline preceding the ending note." + +} + +\version "2.9.5" + +\paper { + ragged-right = ##t +} + +\relative c'' { + \set hairpinToBarline = ##t + \override Hairpin #'bound-padding = #1.0 + c4\< c2. c4\! +} diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 3c1a517942..6720e77745 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -326,11 +326,21 @@ Dynamic_engraver::typeset_all () { if (finished_cresc_) { - if (!finished_cresc_->get_bound (RIGHT)) + bool use_bar = to_boolean (get_property ("hairpinToBarline")) + && scm_is_string (get_property ("whichBar")) + && !script_ev_; + + + if (!finished_cresc_->get_bound (RIGHT) + || use_bar) { + Grob *column_bound = unsmob_grob (use_bar + ? get_property ("currentCommandColumn") + : get_property ("currentMusicalColumn")); + finished_cresc_->set_bound (RIGHT, script_ ? script_ - : unsmob_grob (get_property ("currentMusicalColumn"))); + : column_bound); if (finished_line_spanner_) add_bound_item (finished_line_spanner_, diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 09efaf4986..8f0252acd2 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -162,7 +162,7 @@ Hairpin::print (SCM smob) x_points[d] = e.center () - d * padding / 3; } else - x_points[d] = e[d]; + x_points[d] = e[d] - d * padding; } } } diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index 4c0a71305b..427c14c2bc 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -238,6 +238,8 @@ for the full staff.") (gridInterval ,ly:moment? "Interval for which to generate @ref{GridPoint}s") + (hairpinToBarline ,boolean? "If set, end a hairpin at the barline before the ending note.") + (harmonicAccidentals ,boolean? "If set, harmonic notes in chords get accidentals.") (highStringOne ,boolean? "Whether the 1st string is the string with -- 2.39.2