]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/box.cc
Makes all side-positioning based on skylines instead of boxes.
[lilypond.git] / lily / box.cc
index 52af33a142362dc26bcf3f9c94727d7e930d1f3c..bc0a975ed0d3d91b0be837f5810af3fb8b991795 100644 (file)
@@ -51,6 +51,13 @@ Box::set_empty ()
   interval_a_[Y_AXIS].set_empty ();
 }
 
+bool
+Box::is_empty () const
+{
+  return interval_a_[X_AXIS].is_empty ()
+         || interval_a_[Y_AXIS].is_empty ();
+}
+
 Box::Box (Interval ix, Interval iy)
 {
   x () = ix;
@@ -97,6 +104,13 @@ Box::widen (Real x, Real y)
   interval_a_[Y_AXIS].widen (y);
 }
 
+void
+Box::intersect (Box b)
+{
+  interval_a_[X_AXIS].intersect (b[X_AXIS]);
+  interval_a_[Y_AXIS].intersect (b[Y_AXIS]);
+}
+
 // for debugging
 
 void