X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Faxis-group-interface.cc;h=c253b4adfbb6d26402507039e19781c40a5d07c5;hb=24bdff1e3d1639f8e6ebfc9611f38ea2c13be262;hp=4ce0a01a65918d486bb1d7be9dca9603eb8ef9be;hpb=2f38710a2b40a24977441aa7faa05b6ab132f3cf;p=lilypond.git diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 4ce0a01a65..c253b4adfb 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -1,9 +1,20 @@ /* - axis-group-interface.cc -- implement Axis_group_interface + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2000--2009 Han-Wen Nienhuys - (c) 2000--2009 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "axis-group-interface.hh" @@ -77,6 +88,15 @@ Axis_group_interface::relative_group_extent (vector const &elts, Interval Axis_group_interface::cached_pure_height (Grob *me, int start, int end) +{ + Interval iv = begin_of_line_pure_height (me, start); + iv.unite (rest_of_line_pure_height (me, start, end)); + + return iv; +} + +Interval +Axis_group_interface::rest_of_line_pure_height (Grob *me, int start, int end) { SCM adjacent_pure_heights = me->get_property ("adjacent-pure-heights"); @@ -691,6 +711,18 @@ Axis_group_interface::calc_next_staff_spacing (SCM smob) return me->get_property ("default-next-staff-spacing"); } +Real +Axis_group_interface::minimum_distance (Grob *g1, Grob *g2, Axis a) +{ + SCM sym = ly_symbol2scm ((a == Y_AXIS) ? "vertical-skylines" : "horizontal-skylines"); + + Skyline_pair *s1 = Skyline_pair::unsmob (g1->get_property (sym)); + Skyline_pair *s2 = Skyline_pair::unsmob (g2->get_property (sym)); + if (s1 && s2) + return (*s1)[DOWN].distance ((*s2)[UP]); + return 0; +} + ADD_INTERFACE (Axis_group_interface, "An object that groups other layout objects.", @@ -708,6 +740,7 @@ ADD_INTERFACE (Axis_group_interface, "inter-staff-spacing " "keep-fixed-while-stretching " "max-stretch " + "non-affinity-spacing " "next-staff-spacing " "no-alignment " "pure-Y-common " @@ -715,5 +748,6 @@ ADD_INTERFACE (Axis_group_interface, "pure-relevant-spanners " "staff-affinity " "staff-grouper " + "system-Y-offset " "vertical-skylines " );