]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #430.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 31 Aug 2007 03:16:33 +0000 (00:16 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 31 Aug 2007 03:16:33 +0000 (00:16 -0300)
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
scm/define-grobs.scm

index 43665211bfeb649b4e172d314018b4385ea09380..19d9a88dc8ac86676ff2496a636c77167dc5dead 100644 (file)
 #include <algorithm>
 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);
 
index 72a31eddbc87768fb4cb5c3c8c045fd39177e7ef..ba600479635ff0e4f28d4c2c14996b720ba53aa7 100644 (file)
        (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)