]> git.donarmstrong.com Git - lilypond.git/commitdiff
Gives tremoli a pure height function to fix horizontal spacing.
authorMike Solomon <mike@apollinemike.com>
Tue, 26 Jul 2011 15:05:36 +0000 (17:05 +0200)
committerMike Solomon <mike@apollinemike.com>
Tue, 26 Jul 2011 15:05:36 +0000 (17:05 +0200)
Now, tremoli do not collide with neighboring noteheads in tight
spacing situations.

input/regression/stem-tremolo-note-column.ly [new file with mode: 0644]
lily/include/stem-tremolo.hh
lily/stem-tremolo.cc
scm/define-grobs.scm
scm/safe-lily.scm

diff --git a/input/regression/stem-tremolo-note-column.ly b/input/regression/stem-tremolo-note-column.ly
new file mode 100644 (file)
index 0000000..b09bd02
--- /dev/null
@@ -0,0 +1,12 @@
+\version "2.15.6"
+\header{
+  texidoc="Stem tremolos count in a note column's horizontal skyline.
+"
+}
+
+
+\relative c'' {
+  \autoBeamOff
+  \override NoteHead #'stencil = #(ly:make-stencil '() '(0 . 0) '(0 . 0))
+  \repeat unfold 8 { b8:32 }
+}
index f3f5931adc4ce4e8d57a328a78a27503de911a77..adc2c0c0b4607913ea7c546c22e4ee4bb03f7d93 100644 (file)
@@ -31,9 +31,9 @@ public:
   DECLARE_SCHEME_CALLBACK (calc_slope, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_width, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
-  DECLARE_SCHEME_CALLBACK (height, (SCM));
   DECLARE_SCHEME_CALLBACK (width, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_style, (SCM));
+  DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
   static Stencil raw_stencil (Grob *, Real slope, Direction stemdir);
   static Stencil translated_stencil (Grob*, Real slope);
   static Stencil untranslated_stencil (Grob*, Real slope);
index 4d1678889a63ee382a4a207bf5d31fd2424194f2..5a115835ef55cc8561dfda677b5ef0b7f2c060a0 100644 (file)
@@ -146,16 +146,16 @@ Stem_tremolo::raw_stencil (Grob *me, Real slope, Direction stemdir)
 
 
 
-MAKE_SCHEME_CALLBACK (Stem_tremolo, height, 1);
+MAKE_SCHEME_CALLBACK (Stem_tremolo, pure_height, 3);
 SCM
-Stem_tremolo::height (SCM smob)
+Stem_tremolo::pure_height (SCM smob, SCM, SCM)
 {
   Grob *me = unsmob_grob (smob);
 
   /*
     Cannot use the real slope, since it looks at the Beam.
    */
-  Stencil s1 (translated_stencil (me, 0.35));
+  Stencil s1 (untranslated_stencil (me, 0.35));
 
   return ly_interval2scm (s1.extent (Y_AXIS));
 }
index a5c03a52755c7cc3bdfac07960833e799ba7730b..65b59bb01bdbfcec293b3a0b2a807b58558661d0 100644 (file)
        (stencil . ,ly:stem-tremolo::print)
        (style . ,ly:stem-tremolo::calc-style)
        (X-extent . ,ly:stem-tremolo::width)
-       (Y-extent . ,ly:stem-tremolo::height)
        (meta . ((class . Item)
                 (interfaces . (stem-tremolo-interface))))))
 
     (,ly:arpeggio::brew-chord-bracket . ,ly:arpeggio::pure-height)
     (,ly:arpeggio::brew-chord-slur . ,ly:arpeggio::pure-height)
     (,ly:hairpin::print . ,ly:hairpin::pure-height)
+    (,ly:stem-tremolo::print . ,ly:stem-tremolo::pure-height)
     (,ly:volta-bracket-interface::print . ,volta-bracket-interface::pure-height)))
 
 ;; ly:grob::stencil-extent is safe if the print callback is safe too
index 60ac97920bbd5984c07d8e3f9f849442ea2686dc..52e4bdeeb7023caa0f7dd348b68551ce08f05682 100644 (file)
    ly:stem::height
    ly:stem::offset-callback
    ly:stem::print
-   ly:stem-tremolo::height
    ly:stem-tremolo::print
    ly:sustain-pedal::print
    ly:system-start-delimiter::print