From 277bb30e28d026f359b6a4de36060ddcb9ecd93b Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Thu, 9 Aug 2012 21:52:51 -0700 Subject: [PATCH] hairpin.cc: consider suicide before drawing stencil; issue 2583 --- input/regression/hairpin-barline-break.ly | 10 +++++++++- lily/grob-property.cc | 2 +- lily/hairpin.cc | 12 +++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/input/regression/hairpin-barline-break.ly b/input/regression/hairpin-barline-break.ly index 4d442a3655..6381b08c08 100644 --- a/input/regression/hairpin-barline-break.ly +++ b/input/regression/hairpin-barline-break.ly @@ -1,14 +1,22 @@ \header { - texidoc = "If a hairpin ends on the first note of a new stave, we + texidoc = "If a hairpin ends on the first note of a new staff, we do not print that ending. But on the previous line, this hairpin should not be left open, and should end at the bar line. " } \version "2.14.0" +\layout { + line-width = 4.\cm +} + \relative c' { c1\> \break c1\! + \override Hairpin #'to-barline = ##f + c1\> + \break + c1\! } diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 22c5fe2e71..db16f2a54a 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -251,7 +251,7 @@ Grob::try_callback_on_alist (SCM *alist, SCM sym, SCM proc) value = get_property_data (sym); assert (value == SCM_EOL || value == marker); if (value == marker) - *alist = scm_assq_remove_x (*alist, marker); + *alist = scm_assq_remove_x (*alist, sym); } else { diff --git a/lily/hairpin.cc b/lily/hairpin.cc index cacfb0f51c..40e165dd6d 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -127,14 +127,16 @@ Hairpin::print (SCM smob) broken[d] = bounds[d]->break_status_dir () != CENTER; } - broken[RIGHT] = broken[RIGHT] && me->broken_neighbor (RIGHT); - broken[RIGHT] = broken[RIGHT] && me->broken_neighbor (RIGHT)->is_live (); - if (broken[RIGHT]) { Spanner *next = me->broken_neighbor (RIGHT); - Stencil *s = next->get_stencil (); - if (!s || s->is_empty ()) + // Hairpin-parts suicide in after-line-breaking if they need not be drawn + if (next) + { + (void) next->get_property ("after-line-breaking"); + broken[RIGHT] = next->is_live (); + } + else broken[RIGHT] = false; } -- 2.39.5