X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Faxis-group-interface.cc;h=8089d316f948ac0e25b5f834a5ca8f7d72d94a63;hb=f5817f0eb5066fde9b0cb2b87b05ba8e776bd18b;hp=b589ff671ec52d8e34db78f10ce5196b1fc1866a;hpb=4790df2a2c3cdcd14479e8ece60a99ab803f6197;p=lilypond.git diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index b589ff671e..8089d316f9 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -97,7 +97,7 @@ Axis_group_interface::cached_pure_height (Grob *me, int start, int end) for (vsize i = 0; i + 1 < breaks.size (); i++) { int r = Paper_column::get_rank (cols[breaks[i]]); - if (r > end) + if (r >= end) break; if (r >= start) @@ -263,13 +263,6 @@ Axis_group_interface::calc_skylines (SCM smob) extract_grob_set (me, "elements", elts); Skyline_pair skylines = skyline_spacing (me, elts); - /* add a minimum-Y-extent-sized box to the skyline */ - SCM min_y_extent = me->get_property ("minimum-Y-extent"); - if (is_number_pair (min_y_extent)) - { - Box b (me->extent (me, X_AXIS), ly_scm2interval (min_y_extent)); - skylines.insert (b, 0, X_AXIS); - } return skylines.smobbed_copy (); } @@ -392,26 +385,33 @@ Axis_group_interface::calc_pure_elts_and_common (Grob *me) return common; } -MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_x_common, 1); SCM -Axis_group_interface::calc_x_common (SCM grob) +Axis_group_interface::calc_common (Grob *me, Axis axis) { - Grob *me = unsmob_grob (grob); - extract_grob_set (me, "elements", elts); - Grob *common = common_refpoint_of_array (elts, me, X_AXIS); + Grob *common = common_refpoint_of_array (elts, me, axis); + if (!common) + { + me->programming_error ("No common parent found in calc_common axis."); + return SCM_EOL; + } + return common->self_scm (); } + +MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_x_common, 1); +SCM +Axis_group_interface::calc_x_common (SCM grob) +{ + return calc_common (unsmob_grob (grob), X_AXIS); +} + MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_y_common, 1); SCM Axis_group_interface::calc_y_common (SCM grob) { - Grob *me = unsmob_grob (grob); - - extract_grob_set (me, "elements", elts); - Grob *common = common_refpoint_of_array (elts, me, Y_AXIS); - return common->self_scm (); + return calc_common (unsmob_grob (grob), Y_AXIS); } Interval @@ -635,7 +635,6 @@ Axis_group_interface::print (SCM smob) } ADD_INTERFACE (Axis_group_interface, - "An object that groups other layout objects.", /* properties */