From 1c4662c4773eb0c646011c82a2dd2f7c5f92a283 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Mon, 11 Jul 2011 18:03:40 +0200 Subject: [PATCH] Fix 1563: System start bars interpreted collapse-height as absolute length. 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. --- .../system-start-bar-collapse-staffspace.ly | 12 ++++++++++++ lily/system-start-delimiter.cc | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 input/regression/system-start-bar-collapse-staffspace.ly diff --git a/input/regression/system-start-bar-collapse-staffspace.ly b/input/regression/system-start-bar-collapse-staffspace.ly new file mode 100644 index 0000000000..94af60276c --- /dev/null +++ b/input/regression/system-start-bar-collapse-staffspace.ly @@ -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 +} diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 3f671e3316..25da049439 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -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; -- 2.39.2