X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Faxis-group-interface.cc;h=639c8b6267a12a6450cfe7739009e7e6b311cdbb;hb=8cab78caa0db1ba14f2e52e4c1ddbb541ea0e5cb;hp=186205195a609543ac02d4c40896fe74d7819837;hpb=eda0b8d4348f476fd54738dcc9ac3c2e85675ab3;p=lilypond.git diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 186205195a..639c8b6267 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2000--2007 Han-Wen Nienhuys + (c) 2000--2009 Han-Wen Nienhuys */ #include "axis-group-interface.hh" @@ -579,6 +579,15 @@ add_grobs_of_one_priority (Skyline_pair *const skylines, Skyline_pair Axis_group_interface::skyline_spacing (Grob *me, vector elements) { + /* For grobs with an outside-staff-priority, the sorting function might + call extent and cause suicide. This breaks the contract that is required + for the STL sort function. To avoid this, we make sure that any suicides + are triggered beforehand. + */ + for (vsize i = 0; i < elements.size (); i++) + if (scm_is_number (elements[i]->get_property ("outside-staff-priority"))) + elements[i]->extent (elements[i], X_AXIS); + vector_sort (elements, staff_priority_less); Grob *x_common = common_refpoint_of_array (elements, me, X_AXIS); Grob *y_common = common_refpoint_of_array (elements, me, Y_AXIS); @@ -630,7 +639,6 @@ Axis_group_interface::calc_max_stretch (SCM smob) return scm_from_double (ret); } -extern bool debug_skylines; MAKE_SCHEME_CALLBACK (Axis_group_interface, print, 1) SCM Axis_group_interface::print (SCM smob) @@ -642,8 +650,10 @@ Axis_group_interface::print (SCM smob) Stencil ret; if (Skyline_pair *s = Skyline_pair::unsmob (me->get_property ("vertical-skylines"))) { - ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[UP].to_points (X_AXIS)).in_color (255, 0, 255)); - ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[DOWN].to_points (X_AXIS)).in_color (0, 255, 255)); + ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[UP].to_points (X_AXIS)) + .in_color (255, 0, 255)); + ret.add_stencil (Lookup::points_to_line_stencil (0.1, (*s)[DOWN].to_points (X_AXIS)) + .in_color (0, 255, 255)); } return ret.smobbed_copy (); }