]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem-tremolo.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / stem-tremolo.cc
index b3ea13d30d1f0fac3992b4ae9391e10b76e9f99f..f15d2c4154c8a3a7b5dae379bbd5ff3368ba1415 100644 (file)
@@ -86,23 +86,6 @@ Stem_tremolo::get_beam_translation (Grob *me)
   return  beam ? Beam::get_beam_translation (beam) : 0.81;
 }
 
-/* FIXME: move to Lookup? */
-Stencil
-Stem_tremolo::rotated_box (Real slope, Real width, Real thick, Real blot)
-{
-  vector<Offset> pts;
-  Offset rot (1, slope);
-
-  thick -= 2*blot;
-  width -= 2*blot;
-  rot /= sqrt (1 + slope*slope);
-  pts.push_back (Offset (0, -thick / 2) * rot);
-  pts.push_back (Offset (width, -thick / 2) * rot);
-  pts.push_back (Offset (width, thick / 2) * rot);
-  pts.push_back (Offset (0, thick / 2) * rot);
-  return Lookup::round_filled_polygon (pts, blot);
-}
-
 Stencil
 Stem_tremolo::raw_stencil (Grob *me, Real slope, Direction stemdir)
 {
@@ -117,9 +100,12 @@ Stem_tremolo::raw_stencil (Grob *me, Real slope, Direction stemdir)
   width *= ss;
   thick *= ss;
 
-  Stencil a = style == ly_symbol2scm ("rectangle") ?
-    rotated_box (slope, width, thick, blot) :
-    Lookup::beam (slope, width, thick, blot);
+  Stencil a;
+  if (style == ly_symbol2scm ("rectangle"))
+    a = Lookup::rotated_box (slope, width, thick, blot);
+  else
+    a = Lookup::beam (slope, width, thick, blot);
+
   a.align_to (X_AXIS, CENTER);
   a.align_to (Y_AXIS, CENTER);
 
@@ -216,8 +202,8 @@ Stem_tremolo::print (SCM grob)
       /* we shouldn't position relative to the end of the stem since the stem
          is invisible */
       vector<int> nhp = Stem::note_head_positions (stem);
-      Real note_head = (stemdir == UP ? nhp.back () : nhp[0]);
-      end_y = note_head + stemdir * 2.0;
+      Real note_head = (stemdir == UP ? nhp.back () : nhp[0]) * ss / 2;
+      end_y = note_head + stemdir * 1.5;
     }
   mol.translate_axis (end_y, Y_AXIS);