]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 16 May 2006 19:00:39 +0000 (19:00 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 16 May 2006 19:00:39 +0000 (19:00 +0000)
ChangeLog
input/regression/hairpin-to-barline.ly [new file with mode: 0644]
lily/dynamic-engraver.cc
lily/hairpin.cc
scm/define-context-properties.scm

index 9788dca989afc8c3f0ae881115adda0121f0e9bd..8cf2bf6eb46541d7cbaf5698114dd5d91e71ee5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,17 @@
 
 2006-05-16  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * 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 (file)
index 0000000..db0483b
--- /dev/null
@@ -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\!
+}
index 3c1a517942d4477fe686d6a29406d33adfd1085f..6720e777454fd1a2c95da545ddd4c62652dd1186 100644 (file)
@@ -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_,
index 09efaf49866f35a97c7a1126859357077cddeaba..8f0252acd252c00d5fdd4320f066f71879e69f5e 100644 (file)
@@ -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;
            }
        }
     }
index 4c0a71305bd166ca1cc05658c3d4505b2da2db05..427c14c2bc9a0196d4759959b193640c6b50f80a 100644 (file)
@@ -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