]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam.cc
Run fixcc.py with astyle 2.02
[lilypond.git] / lily / beam.cc
index d0b975ec04c10f74d7afe6c58f6798b5f49b334d..0cfc3e193cba6b3feea911abb09a6f9e5118d6c2 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "beam.hh"
 
+#include "axis-group-interface.hh"
 #include "align-interface.hh"
 #include "beam-scoring-problem.hh"
 #include "beaming-pattern.hh"
@@ -483,8 +484,8 @@ Beam::calc_beam_segments (SCM smob)
                       && me->get_bound (event_dir)->break_status_dir ())
                     {
                       current.horizontal_[event_dir]
-                        = (robust_relative_extent (me->get_bound (event_dir),
-                                                   commonx, X_AXIS)[RIGHT]
+                        = (Axis_group_interface::generic_bound_extent (me->get_bound (event_dir),
+                                                                       commonx, X_AXIS)[RIGHT]
                            + event_dir * break_overshoot[event_dir]);
                     }
                   else
@@ -1237,9 +1238,16 @@ Beam::rest_collision_callback (SCM smob, SCM prev_offset)
       || !Beam::normal_stem_count (beam))
     return scm_from_double (0.0);
 
+  Grob *common_y = rest->common_refpoint (beam, Y_AXIS);
+
   Drul_array<Real> pos (robust_scm2drul (beam->get_property ("positions"),
                                          Drul_array<Real> (0, 0)));
 
+  Direction dir = LEFT;
+  do
+    pos[dir] += beam->relative_coordinate (common_y, Y_AXIS);
+  while (flip (&dir) != LEFT);
+
   Real staff_space = Staff_symbol_referencer::staff_space (rest);
 
   scale_drul (&pos, staff_space);
@@ -1272,8 +1280,6 @@ Beam::rest_collision_callback (SCM smob, SCM prev_offset)
                             + (beam_count - 1) * beam_translation;
   Real beam_y = stem_y - d * height_of_my_beams;
 
-  Grob *common_y = rest->common_refpoint (beam, Y_AXIS);
-
   Interval rest_extent = rest->extent (rest, Y_AXIS);
   rest_extent.translate (offset + rest->get_parent (Y_AXIS)->relative_coordinate (common_y, Y_AXIS));
 
@@ -1315,7 +1321,8 @@ Beam::pure_rest_collision_callback (SCM smob,
     return scm_from_double (amount);
   Grob *beam = unsmob_grob (stem->get_object ("beam"));
   if (!beam
-      || !Beam::normal_stem_count (beam))
+      || !Beam::normal_stem_count (beam)
+      || !is_direction (beam->get_property_data ("direction")))
     return scm_from_double (amount);
 
   Real ss = Staff_symbol_referencer::staff_space (me);