]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 1563: System start bars interpreted collapse-height as absolute length.
authorReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 11 Jul 2011 16:03:40 +0000 (18:03 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 22 Jul 2011 12:03:19 +0000 (14:03 +0200)
If you increased the staff-space, this meant sometimes the collapse-height
would not be enough to hide the start-bar for a staff, while in other cases
it was enough...

This patch interprets the collapse-height in multiples of the staff-space.

However, I think that the notion of a collapse-height (as a length) for
hiding/showing the system start delimiter is not the best approach in
general. Sooner or later, we should change the system to show/hide the
system start bar/bracket depending on the number of staves involved rather
than on grob height.

input/regression/system-start-bar-collapse-staffspace.ly [new file with mode: 0644]
lily/system-start-delimiter.cc

diff --git a/input/regression/system-start-bar-collapse-staffspace.ly b/input/regression/system-start-bar-collapse-staffspace.ly
new file mode 100644 (file)
index 0000000..94af602
--- /dev/null
@@ -0,0 +1,12 @@
+\version "2.15.6"
+
+\header {
+  texidoc = "When the staff-space is increased, the system-start delimiter
+should still be collapsed (i.e. the collapse-height should not give an absolute
+length, but a multiple of staff-spaces)."
+}
+
+\new Staff \with { \override StaffSymbol #'staff-space = #1.4 }
+{
+  a4 b c d 
+}
index 3f671e3316135f60c593753eab550e545cb1395f..25da0494395a5c158bab33a1f5860e51c6bb5c15 100644 (file)
@@ -100,6 +100,7 @@ System_start_delimiter::print (SCM smob)
   Grob *common = common_refpoint_of_array (elts, me, Y_AXIS);
 
   Interval ext;
+  Real staffspace = 1.0;
   int non_empty_count = 0;
   for (vsize i = elts.size (); i--;)
     {
@@ -113,14 +114,17 @@ System_start_delimiter::print (SCM smob)
            {
              non_empty_count ++;
              ext.unite (dims);
+              staffspace = Staff_symbol_referencer::staff_space (sp);
            }
        }
     }
 
   SCM glyph_sym = me->get_property ("style");
   Real len = ext.length ();
+
+  // Use collapse-height in multiples of the staff-space
   if (ext.is_empty ()
-      || (robust_scm2double (me->get_property ("collapse-height"), 0.0) >= ext.length ()))
+      || (robust_scm2double (me->get_property ("collapse-height"), 0.0) >= (len / staffspace)))
     {
       me->suicide ();
       return SCM_UNSPECIFIED;