]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/separation-item.cc
Add Anders Pilegaard to contributors
[lilypond.git] / lily / separation-item.cc
index 6ff2928072541611bda6db49d7cb64626d8ab4c3..8a32363eb4d2b0d8c6df9c321f429cbee8886e8d 100644 (file)
@@ -150,10 +150,19 @@ Separation_item::boxes (Grob *me, Grob *left)
       Interval extra_height = robust_scm2interval (elts[i]->get_property ("extra-spacing-height"),
                                                    Interval (0.0, 0.0));
 
-      x[LEFT] += extra_width[LEFT];
-      x[RIGHT] += extra_width[RIGHT];
-      y[DOWN] += extra_height[DOWN];
-      y[UP] += extra_height[UP];
+      // The conventional empty extent is (+inf.0 . -inf.0)
+      //  but (-inf.0 . +inf.0) is used as extra-spacing-height
+      //  on items that must not overlap other note-columns.
+      // If these two uses of inf combine, leave the empty extent.
+
+      if (!isinf (x[LEFT]))
+        x[LEFT] += extra_width[LEFT];
+      if (!isinf (x[RIGHT]))
+        x[RIGHT] += extra_width[RIGHT];
+      if (!isinf (y[DOWN]))
+        y[DOWN] += extra_height[DOWN];
+      if (!isinf (y[UP]))
+        y[UP] += extra_height[UP];
 
       if (!x.is_empty () && !y.is_empty ())
         out.push_back (Box (x, y));