From 89088fc769ae0dd222bb2492f9d9b6710a65bf02 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 3 Jan 2007 14:31:14 +0100 Subject: [PATCH] Fix #154. Check hairpin bound for Note_column with has_rests, and adjust hairpin end. --- input/regression/hairpin-to-rest.ly | 11 +++++++++++ lily/hairpin.cc | 10 +++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 input/regression/hairpin-to-rest.ly diff --git a/input/regression/hairpin-to-rest.ly b/input/regression/hairpin-to-rest.ly new file mode 100644 index 0000000000..3ba757d520 --- /dev/null +++ b/input/regression/hairpin-to-rest.ly @@ -0,0 +1,11 @@ +\version "2.10.8" +\header { + texidoc = "Hairpins end at the left edge of a rest." +} + +\layout{ + ragged-right=##t +} +\relative c'' { + c2\p\> r4\! +} diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 891baf0e0c..c03031dc44 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -9,16 +9,15 @@ #include "hairpin.hh" #include "dimensions.hh" -#include "font-interface.hh" #include "international.hh" #include "line-interface.hh" -#include "lookup.hh" #include "output-def.hh" #include "paper-column.hh" #include "pointer-group-interface.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" #include "text-interface.hh" +#include "note-column.hh" #include "warn.hh" MAKE_SCHEME_CALLBACK (Hairpin, after_line_breaking, 1); @@ -167,7 +166,12 @@ Hairpin::print (SCM smob) } else { - x_points[d] = e[d]; + if (Note_column::has_interface (b) + && Note_column::has_rests (b)) + x_points[d] = e[-d]; + else + x_points[d] = e[d]; + Item *bound = me->get_bound (d); if (bound->is_non_musical (bound)) x_points[d] -= d * padding; -- 2.39.2