]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #1056: Incorrect height estimation for stems
authorBoris Shingarov <shingarov@gmail.com>
Sat, 15 May 2010 21:28:32 +0000 (22:28 +0100)
committerNeil Puttock <n.puttock@gmail.com>
Sat, 15 May 2010 21:28:32 +0000 (22:28 +0100)
Check for user-overridden 'length when calculating pure height.

lily/stem.cc

index 314f74e2b42108d7062c6d85238320bb283327df..6bbeb162889776eebb2078056613432fe90f6eab 100644 (file)
@@ -255,7 +255,13 @@ Stem::pure_height (SCM smob,
 
   if (!to_boolean (me->get_property ("cross-staff")))
     {
-      Real len = scm_to_double (calc_length (smob)) * ss / 2;
+      Real len_in_halfspaces;
+      SCM user_set_len_scm = me->get_property_data ("length");
+      if (scm_is_number (user_set_len_scm))
+       len_in_halfspaces = scm_to_double (user_set_len_scm);
+      else
+       len_in_halfspaces = scm_to_double (calc_length (smob));
+      Real len = len_in_halfspaces * ss / 2;
       Direction dir = get_grob_direction (me);
 
       Interval hp = head_positions (me);