]> git.donarmstrong.com Git - lilypond.git/commitdiff
Avoid more cyclic dependencies for adjacent-pure-heights
authorJoe Neeman <joeneeman@gmail.com>
Mon, 30 Jul 2007 08:19:57 +0000 (18:19 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 30 Jul 2007 08:19:57 +0000 (18:19 +1000)
lily/axis-group-interface.cc
lily/include/side-position-interface.hh
lily/side-position-interface.cc
scm/define-grobs.scm

index 4d280ac4802eb64dadd8833c08209564082ca430..291c799910e56d6f8109adc593597ac5275ced02 100644 (file)
@@ -151,7 +151,8 @@ Axis_group_interface::adjacent_pure_heights (SCM smob)
       for (vsize j = 0; j < spanners.size (); j++)
        {
          Interval_t<int> rank_span = spanners[j]->spanned_rank_interval ();
-         if (rank_span[LEFT] <= end && rank_span[RIGHT] >= start)
+         if (rank_span[LEFT] <= end && rank_span[RIGHT] >= start
+             && !to_boolean (spanners[j]->get_property ("cross-staff")))
            {
              Interval dims = spanners[j]->pure_height (common, start, end);
              if (!dims.is_empty ())
index dc105cea4abc2666187d517de196fe124e4c7f51..88f8735d6853dcd0d881f6045aee32bd48664940 100644 (file)
@@ -26,6 +26,7 @@ public:
   DECLARE_SCHEME_CALLBACK (x_aligned_side, (SCM element, SCM current));
   DECLARE_SCHEME_CALLBACK (y_aligned_side, (SCM element, SCM current));
   DECLARE_SCHEME_CALLBACK (pure_y_aligned_side, (SCM element, SCM start, SCM end, SCM current));
+  DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM element));
 
   static SCM aligned_side (Grob*me, Axis a, bool pure, int start, int end, Real *current_off_ptr);
 
index 14d5c8903d24c953f655de51910265af353c65a1..43665211bfeb649b4e172d314018b4385ea09380 100644 (file)
@@ -201,6 +201,17 @@ Side_position_interface::pure_y_aligned_side (SCM smob, SCM start, SCM end, SCM
                                   cur_off);
 }
 
+MAKE_SCHEME_CALLBACK (Side_position_interface, calc_cross_staff, 1)
+SCM
+Side_position_interface::calc_cross_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  extract_grob_set (me, "side-support-elements", elts);
+
+  Grob *common = common_refpoint_of_array (elts, me->get_parent (Y_AXIS), Y_AXIS);
+  return scm_from_bool (common != me->get_parent (Y_AXIS));
+}
+
 SCM
 Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, int end,
                                       Real *current_off)
index 2115355f03279d495da34122dd434a986cf5da4d..6b2135c9e6014e8fb45633f1bdb3a21ae3830b1a 100644 (file)
        (outside-staff-priority . 250)
        (Y-extent . ,ly:axis-group-interface::height)
        (X-extent . ,ly:axis-group-interface::width)
+       (cross-staff . ,ly:side-position-interface::calc-cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (axis-group-interface
                                dynamic-interface