]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem-tremolo.cc
(protect_smob): experiment: O(1) GC (un)protection.
[lilypond.git] / lily / stem-tremolo.cc
index 132a30b3a2b8df26786fe8719cd5153082e2723e..dc7bc0357349effde51578c6723095e624a41f39 100644 (file)
@@ -52,7 +52,7 @@ Stem_tremolo::height (SCM smob, SCM ax)
 Stencil
 Stem_tremolo::raw_stencil (Grob *me)
 {
-  Grob *stem = unsmob_grob (me->get_property ("stem"));
+  Grob *stem = unsmob_grob (me->get_object ("stem"));
   Spanner *beam = Stem::get_beam (stem);
   Real dydx;
   if (beam)
@@ -88,7 +88,7 @@ Stem_tremolo::raw_stencil (Grob *me)
 
   if (!tremolo_flags)
     {
-      programming_error ("No tremolo flags?");
+      programming_error ("no tremolo flags");
 
       me->suicide ();
       return Stencil ();
@@ -112,10 +112,10 @@ SCM
 Stem_tremolo::print (SCM grob)
 {
   Grob *me = unsmob_grob (grob);
-  Grob *stem = unsmob_grob (me->get_property ("stem"));
+  Grob *stem = unsmob_grob (me->get_object ("stem"));
   if (!stem)
     {
-      programming_error ("No stem for stem-tremolo");
+      programming_error ("no stem for stem-tremolo");
       return SCM_EOL;
     }
 
@@ -144,7 +144,7 @@ Stem_tremolo::print (SCM grob)
   Real end_y
     = Stem::stem_end_position (stem) * ss / 2
     - stemdir * (beam_count * beamthickness
-                + ((beam_count -1) >? 0) * beam_translation);
+                + (max (beam_count -1, 0) * beam_translation));
 
   /* FIXME: the 0.33 ss is to compensate for the size of the note head.  */
   Real chord_start_y = Stem::chord_start_y (stem) + 0.33 * ss * stemdir;