]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 352.
authorJoe Neeman <joeneeman@gmail.com>
Sat, 21 Apr 2007 23:29:43 +0000 (09:29 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sat, 21 Apr 2007 23:29:43 +0000 (09:29 +1000)
Ensure that stem-tremolos have a width so they are included in the skyline.

lily/include/stem-tremolo.hh
lily/stem-tremolo.cc
scm/define-grobs.scm

index 36cb146efec3ca588f9d9b0cf3efca54963fd43b..b6512b9960fefd25e5b41a8083d1e9bed349df67 100644 (file)
@@ -21,6 +21,7 @@ public:
   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));
   static Stencil raw_stencil (Grob *, Real slope, Direction stemdir);
   static Stencil translated_stencil (Grob*, Real slope);
index a718b7f69d132918fe6ee370fe87f503a879cc00..b91b18fd5a1e9359edb3747ab50f3b77e45cfd93 100644 (file)
@@ -149,6 +149,20 @@ Stem_tremolo::height (SCM smob)
   return ly_interval2scm (s1.extent (Y_AXIS));
 }
 
+MAKE_SCHEME_CALLBACK (Stem_tremolo, width, 1);
+SCM
+Stem_tremolo::width (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+
+  /*
+    Cannot use the real slope, since it looks at the Beam.
+   */
+  Stencil s1 (untranslated_stencil (me, 0.35));
+
+  return ly_interval2scm (s1.extent (X_AXIS));
+}
+
 Real
 Stem_tremolo::vertical_length (Grob *me)
 {
index 196b5501584c3956287745533d28756d798725b2..9b75b09afe1cb8c3048fb512542c6a1ac025139d 100644 (file)
     (StemTremolo
      . (
        (Y-extent . ,ly:stem-tremolo::height)
+       (X-extent . ,ly:stem-tremolo::width)
        (stencil . ,ly:stem-tremolo::print)
-       (X-extent . #f)
        (slope . ,ly:stem-tremolo::calc-slope)
        (beam-width . ,ly:stem-tremolo::calc-width) ; staff-space
         (style . ,ly:stem-tremolo::calc-style)