From edc9d6124d3687c21bfd54159dcf9c02bc4a47f5 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 31 Aug 2007 00:16:33 -0300 Subject: [PATCH] Fix #430. Ignore stems in side positioning when stemdir != scriptdir. This breaks a cyclic dependency in the case of x-staff beams with scripts on the notes/stems. --- lily/side-position-interface.cc | 25 +++++++++++++++++-------- scm/define-grobs.scm | 6 ++++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 43665211bf..19d9a88dc8 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -12,17 +12,17 @@ #include using namespace std; -#include "note-head.hh" -#include "warn.hh" +#include "directional-element-interface.hh" +#include "grob.hh" #include "main.hh" -#include "staff-symbol-referencer.hh" +#include "misc.hh" +#include "note-head.hh" #include "pointer-group-interface.hh" -#include "directional-element-interface.hh" #include "staff-symbol-referencer.hh" #include "staff-symbol.hh" +#include "stem.hh" #include "string-convert.hh" -#include "misc.hh" -#include "grob.hh" +#include "warn.hh" void Side_position_interface::add_support (Grob *me, Grob *e) @@ -80,9 +80,20 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten dim.unite (staff_extents); } + Direction dir = get_grob_direction (me); + for (vsize i = 0; i < support.size (); i++) { Grob *e = support[i]; + + // In the case of a stem, we will find a note head as well + // ignoring the stem solves cyclic dependencies if the stem is + // attached to a cross-staff beam. + if (a == Y_AXIS + && Stem::has_interface (e) + && dir == - get_grob_direction (e)) + continue; + if (e) if (use_extents) dim.unite (e->maybe_pure_extent (common, a, pure, start, end)); @@ -96,8 +107,6 @@ Side_position_interface::general_side_position (Grob *me, Axis a, bool use_exten if (dim.is_empty ()) dim = Interval (0, 0); - Direction dir = get_grob_direction (me); - Real off = me->get_parent (a)->maybe_pure_coordinate (common, a, pure, start, end); Real minimum_space = ss * robust_scm2double (me->get_property ("minimum-space"), -1); diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 72a31eddbc..ba60047963 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -47,8 +47,10 @@ (Y-extent . ,ly:accidental-interface::height) (X-offset . ,(ly:make-simple-closure `(,+ - ,(ly:make-simple-closure (list ly:self-alignment-interface::centered-on-x-parent)) - ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self))))) + ,(ly:make-simple-closure + (list ly:self-alignment-interface::centered-on-x-parent)) + ,(ly:make-simple-closure + (list ly:self-alignment-interface::x-aligned-on-self))))) (self-alignment-X . ,CENTER) (font-size . -2) (glyph-name-alist . ,standard-alteration-glyph-name-alist) -- 2.39.5