]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
Make Timing_translator do a more thorough job of initializing Timing
[lilypond.git] / lily / grob.cc
index 4e661ebf4ee5d3cc3d531845d03febde41937d61..4c54cbc508a318938b50ef5258ce012ff2f381f2 100644 (file)
@@ -81,9 +81,9 @@ Grob::Grob (SCM basicprops)
   if (get_property_data ("Y-extent") == SCM_EOL)
     set_property ("Y-extent", Grob::stencil_height_proc);
   if (get_property_data ("vertical-skylines") == SCM_EOL)
-    set_property ("vertical-skylines", Grob::simple_vertical_skylines_from_stencil_proc);
+    set_property ("vertical-skylines", Grob::simple_vertical_skylines_from_extents_proc);
   if (get_property_data ("horizontal-skylines") == SCM_EOL)
-    set_property ("horizontal-skylines", Grob::simple_horizontal_skylines_from_stencil_proc);
+    set_property ("horizontal-skylines", Grob::simple_horizontal_skylines_from_extents_proc);
 }
 
 Grob::Grob (Grob const &s)
@@ -472,9 +472,11 @@ Grob::extent (Grob *refp, Axis a) const
     }
 
   // We never want nan, so we avoid shifting infinite values.
-  for (LEFT_and_RIGHT (d))
-    if (!isinf (real_ext[d]))
-      real_ext[d] += offset;
+    if(!isinf (offset))
+      real_ext.translate(offset);
+    else
+      this->warning(_f ("ignored infinite %s-offset",
+                        a == X_AXIS ? "X" : "Y"));
 
   return real_ext;
 }
@@ -483,6 +485,9 @@ Interval
 Grob::pure_height (Grob *refp, int start, int end)
 {
   SCM iv_scm = get_pure_property ("Y-extent", start, end);
+  // TODO: Why is this Interval (0,0)
+  // Shouldn't it just be an empty interval?
+  // 0,0 puts an arbitrary point at 0,0 which will influence spacing
   Interval iv = robust_scm2interval (iv_scm, Interval (0, 0));
   Real offset = pure_relative_y_coordinate (refp, start, end);
 
@@ -923,25 +928,6 @@ common_refpoint_of_array (set<Grob *> const &arr, Grob *common, Axis a)
   return common;
 }
 
-Interval
-maybe_pure_robust_relative_extent (Grob *me, Grob *refp, Axis a, bool pure, int start, int end)
-{
-  if (pure && a != Y_AXIS)
-    programming_error ("tried to get pure X-offset");
-  return (pure && a == Y_AXIS) ? pure_robust_relative_extent (me, refp, start, end)
-         : robust_relative_extent (me, refp, a);
-}
-
-Interval
-pure_robust_relative_extent (Grob *me, Grob *refpoint, int start, int end)
-{
-  Interval ext = me->pure_height (refpoint, start, end);
-  if (ext.is_empty ())
-    ext.add_point (me->pure_relative_y_coordinate (refpoint, start, end));
-
-  return ext;
-}
-
 Interval
 robust_relative_extent (Grob *me, Grob *refpoint, Axis a)
 {