lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tremolo positioning


From: Han-Wen Nienhuys
Subject: Re: Tremolo positioning
Date: Tue, 28 Mar 2006 12:15:27 +0200
User-agent: Thunderbird 1.5 (X11/20060313)

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 - address@hidden - http://www.xs4all.nl/~hanwen

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]