summaryrefslogtreecommitdiff
path: root/lily/separation-item.cc
diff options
context:
space:
mode:
authorMike Solomon <mike@apollinemike.com>2013-03-05 21:03:55 +0100
committerMike Solomon <mike@apollinemike.com>2013-03-05 21:03:55 +0100
commit74e4d219b24ec6d6f28d663c0285418e6c8e122e (patch)
tree6827ab09adb497972de6679cc0ce3558f45c8d21 /lily/separation-item.cc
parentd4802c72d26def39030f2ac897b66c3a268888d5 (diff)
Uses only unpure-pure containers to articulate unpure-pure relationships (issue 3199)
Previously, LilyPond used several different lists in define-grobs.scm to define relationships between unpure and pure functions. This patch eliminates these lists, using unpure-pure containers to articulate these relationships. The modifications required to implement this change are described below: -) axis-group-interface.cc A Scheme function is no longer needed to determine pure relevant grobs. All grobs can have their Y-extents meaningfully pure-evaluated now. The worst-case scenario is that they evaluate to false. Dead grobs, on the other hand, are never pure relevant. The calls to is_live are the only holdovers from the old pure-relevant? scheme function. -) grob-closure.cc We allow unpure-pure containers in simple closures. -) grob-property.cc call_pure_function no longer looks up a Scheme module. Because there are no hard-coded lists in Scheme any more, the function is smaller and writing it in C++ gets slight efficiency gains. -) grob.cc pure_stencil_height used to be a Scheme function in define-grobs.scm. Because it is much simpler (it no longer makes references to lists defined in Scheme), it can be implemented in C++. -) pure-from-neighbor-engraver.cc Similar to axis-group-interface.cc, the pure-relevant distinction is no longer important. -) side-position-interface.cc In order to avoid issues with alterBroken, we only check pure properties before line breaking. -) simple-closure.cc Simple closures were incorrectly evaluated when containing unpure-pure containers. This rectifies that. -) stencil-integral.cc Several pure equivalent functions needed to be written for skylines. -) define-grobs.scm Multiple overrides must be changed to unpure-pure containers. Previous hard-coded lists are all deleted and several functions moved to C++ (see above). -) output-lib.scm Several common unpure-pure containers used in define-grobs.scm are defined here. Several functions from define-grobs.scm pertaining to grob offsets are moved to this file.
Diffstat (limited to 'lily/separation-item.cc')
-rw-r--r--lily/separation-item.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/lily/separation-item.cc b/lily/separation-item.cc
index 6ff2928072..8a32363eb4 100644
--- a/lily/separation-item.cc
+++ b/lily/separation-item.cc
@@ -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));