]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #154.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 13:31:14 +0000 (14:31 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 3 Jan 2007 13:31:45 +0000 (14:31 +0100)
Check hairpin bound for Note_column with has_rests, and adjust hairpin
end.

input/regression/hairpin-to-rest.ly [new file with mode: 0644]
lily/hairpin.cc

diff --git a/input/regression/hairpin-to-rest.ly b/input/regression/hairpin-to-rest.ly
new file mode 100644 (file)
index 0000000..3ba757d
--- /dev/null
@@ -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\!
+}
index 891baf0e0cad504dd06ca15b5909b24cc0a02dee..c03031dc4473751e7a62f8ca7d3e4ac25d869b02 100644 (file)
@@ -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;