]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 647.
authorJoe Neeman <joeneeman@gmail.com>
Sat, 19 Jul 2008 08:42:31 +0000 (18:42 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sat, 19 Jul 2008 08:42:31 +0000 (18:42 +1000)
Add the extra-spacing-height property and use it to prevent
anything from coming too close to a time signature.

Documentation/topdocs/NEWS.tely
lily/item.cc
lily/separation-item.cc
ly/property-init.ly
python/convertrules.py
scm/define-grob-properties.scm
scm/define-grobs.scm

index 44009abed25c9b19e7aae716295fd657a38910b3..5e6ff487e26c9ea98047657607924cab7fd06e67 100644 (file)
@@ -88,6 +88,7 @@ fret diagram properties moved to fret-diagram-details.
 \dimHairpin,
 \sustainUp -> \sustainOff, \sustainDown -> \sustainOn
 \sostenutoDown -> \sostenutoOn, \sostenutoUp -> \sostenutoOff
+2.11.53: infinite-spacing-height -> extra-spacing-height
 @end example
 
 @item
index 3915ea6108bedcb9f60239381dfac7742624221b..e47143e6828ce66b0a94a09847c5a91919efbd4e 100644 (file)
@@ -288,7 +288,7 @@ ADD_INTERFACE (Item,
 
               /* properties */
               "break-visibility "
+              "extra-spacing-height "
               "extra-spacing-width "
-              "infinite-spacing-height "
               "non-musical "
               );
index 2e46c597719bff580a14187c317561cd7d4e4f1b..617c6fd4ebc9e25b641a2a83332f960e79d1427f 100644 (file)
@@ -135,12 +135,15 @@ Separation_item::boxes (Grob *me, Grob *left)
       Interval y (il->pure_height (ycommon, 0, very_large));
       Interval x (il->extent (pc, X_AXIS));
 
-      Interval extra = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"),
-                                           Interval (-0.1, 0.1));
-      x[LEFT] += extra[LEFT];
-      x[RIGHT] += extra[RIGHT];
-      if (to_boolean (elts[i]->get_property ("infinite-spacing-height")))
-       y = Interval (-infinity_f, infinity_f);
+      Interval extra_width = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"),
+                                                 Interval (-0.1, 0.1));
+      Interval extra_height = robust_scm2interval (elts[i]->get_property ("extra-spacing-height"),
+                                                  Interval (-0.1, 0.1));
+
+      x[LEFT] += extra_width[LEFT];
+      x[RIGHT] += extra_width[RIGHT];
+      y[DOWN] += extra_height[DOWN];
+      y[UP] += extra_height[UP];
  
       if (!x.is_empty () && !y.is_empty ())
       out.push_back (Box (x, y));
index 4b385cc4ec9393ae509a9239026ccd5eda2e1c2c..9098d313cf9c113a038e3e8dd82847b0ed288bfc 100644 (file)
@@ -1,6 +1,6 @@
 % property-init.ly
 
-\version "2.11.52"
+\version "2.11.53"
 
 stemUp = \override Stem #'direction = #UP
 stemDown = \override Stem #'direction = #DOWN 
@@ -188,22 +188,22 @@ autoBeamOn = \set autoBeaming = ##t
 
 textLengthOn = {
   \override TextScript #'extra-spacing-width = #'(0 . 0)
-  \override TextScript #'infinite-spacing-height = ##t
+  \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
 }
 
 textLengthOff = {
   \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0)
-  \override TextScript #'infinite-spacing-height = ##f
+  \override TextScript #'extra-spacing-height = #'(0 . 0)
 }
 
 balloonLengthOn = {
   \override BalloonTextItem #'extra-spacing-width = #'(0 . 0)
-  \override BalloonTextItem #'infinite-spacing-height = ##t
+  \override BalloonTextItem #'extra-spacing-height = #'(-inf.0 . +inf.0)
 }
 
 balloonLengthOff = {
   \override BalloonTextItem #'extra-spacing-width = #'(+inf.0 . -inf.0)
-  \override BalloonTextItem #'infinite-spacing-height = ##f
+  \override BalloonTextItem #'extra-spacing-height = #'(0 . 0)
 }
 
 
index 852bf15ba5d2b46025befb29c5b870875bb2844c..12a3b6c5b64655ea8d76e9d08fd534f96e512aa2 100644 (file)
@@ -2785,6 +2785,12 @@ def conv (str):
     str = str.replace ("setHairpinDim", "dimHairpin")
     return str
 
+@rule ((2, 11, 53), "infinite-spacing-height -> extra-spacing-height")
+def conv (str):
+    str = re.sub (r"infinite-spacing-height\s+=\s+##t", r"extra-spacing-height = #'(-inf.0 . +inf.0)", str)
+    str = re.sub (r"infinite-spacing-height\s+=\s+##f", r"extra-spacing-height = #'(0 . 0)", str)
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,
index a46a01f010cd904ec75416f40c7ba88698e39b96..7e57b5e8a76e1cd755c17c38089f247133ff74d1 100644 (file)
@@ -189,6 +189,12 @@ Y@tie{}dimension by this much.")
 offset is added just before outputting the symbol, so the typesetting
 engine is completely oblivious to it.  The values are measured in
 @code{staff-space} units of the staff's @code{StaffSymbol}.")
+     (extra-spacing-height ,number-pair? "In the horizontal spacing
+problem, we increase the height of each item by this amount (by adding
+the @q{car} to the bottom of the item and adding the @q{cdr} to the top
+of the item. In order to make a grob infinitely high (to prevent the
+horizontal spacing problem from placing any other grobs above or below
+this grob), set this to @code{(-inf.0 . +inf.0)}.")
      (extra-spacing-width ,number-pair? "In the horizontal spacing
 problem, we pad each item by this amount (by adding the @q{car} on the
 left side of the item and adding the @q{cdr} on the right side of the
@@ -315,10 +321,6 @@ left and one to the right of this grob.")
      (ignore-collision ,boolean? "If set, don't do note collision
 resolution on this @code{NoteColumn}.")
      (implicit ,boolean? "Is this an implicit bass figure?")
-     (infinite-spacing-height ,boolean? "If true, then for the
-purposes of horizontal spacing, treat this item as though it were
-infinitely tall.  That is, no object from another column is allowed to
-stick above or below this item.")
      (inspect-index ,integer? "If debugging is set, set beam and slur
 configuration to this index, and print the respective scores.")
      (inspect-quants ,number-pair? "If debugging is set,
index 07a22448302f54c754f7c97ccc9ce47ebfba42f2..23154db7a103b89569bab06f57c37fd0f31f5835 100644 (file)
         . ,ly:break-aligned-interface::calc-extent-aligned-anchor)
        (break-visibility . ,all-visible)
        (avoid-slur . inside)
+       (extra-spacing-height . (-1.0 . 1.0))
        (space-alist . (
                        (first-note . (fixed-space . 2.0))
                        (right-edge . (extra-space . 0.5))