Joe Neeman wrote:

+  Real height_of_my_trem = 0.0;
+  Grob *trem = unsmob_grob (me->get_object ("tremolo-flag"));
+  if (trem)
+      height_of_my_trem = ly_scm2interval (trem->get_property 
("Y-extent")).length ()
+        /* hack a bit of space around the trem. */
+        + beam_translation - beam_thickness;

the proper procedure is to call Grob::extent(refp, Y_AXIS) instead.

   Stencil a (Lookup::beam (slope, width, thick, blot));
-  a.translate (Offset (-width * 0.5, width * 0.5 * slope));
+  Interval a_ext = a.extent (Y_AXIS);
+  a.translate (Offset (-width * 0.5, a_ext.length () / 2 - a_ext[UP]));

I think you want Stencil::align_to (CENTER, Y_AXIS)
-      mol.align_to (Y_AXIS, -stemdir);
-      mol.translate_axis (chord_start_y + 0.5 * stemdir, Y_AXIS);
+      Real down_off = mol_ext.length () / 2 + mol_ext[DOWN];
+      mol.translate_axis (-down_off * 2, Y_AXIS);
     }

idem.

Can you resend the patch using more idiomatic code? Thanks!

--

Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to