]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/note-spacing.cc (get_spacing): include left part of right
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 16 Jun 2003 07:53:59 +0000 (07:53 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 16 Jun 2003 07:53:59 +0000 (07:53 +0000)
object in fixed space. This fixes stretched space before
accidentals.

* input/regression/spacing-accidental-stretch.ly: new file.

ChangeLog
Documentation/user/refman.itely
input/regression/spacing-accidental-stretch.ly [new file with mode: 0644]
lily/note-spacing.cc

index 65d2dbd40b65a72f2f5f49a8bad604aedf9bba49..349994c73a48105307d4cd2d6a8d447d163b3710 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-06-16  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/note-spacing.cc (get_spacing): include left part of right
+       object in fixed space. This fixes stretched space before
+       accidentals.
+
+       * input/regression/spacing-accidental-stretch.ly: new file.
+
 2003-06-16  Rune Zedeler  <rz@daimi.au.dk>
 
        * input/mutopia/R.Schumann/romanze-op28-2.ly: Minor fixes.
index 2f87bb7dfa0b501d03fb253af82084917f988558..aaf0cd488d4c09bff8826e2b37faeba792f3e868 100644 (file)
@@ -1640,7 +1640,7 @@ See also @internalsref{PhrasingSlur},
 @refbugs
 
 Phrasing slurs have the same limitations in their formatting as normal
-slurs.
+slurs. Putting phrasing slurs over rests leads to spurious warnings.
 
 @node Breath marks
 @subsection Breath marks
diff --git a/input/regression/spacing-accidental-stretch.ly b/input/regression/spacing-accidental-stretch.ly
new file mode 100644 (file)
index 0000000..00af523
--- /dev/null
@@ -0,0 +1,15 @@
+\version "1.7.21"
+
+\header {
+    texidoc = "Accidentals don't influence the amount of stretchable space. "
+}
+
+\score {
+     \notes \relative c'' \context GrandStaff {
+       \pianoCautionaries
+       d16 d d d d d cis d 
+       
+     }
+     \paper {  linewidth = 14.\cm
+     }
+}
index 9aa593f6696c82c3cdfb5be81f380ab9531c8fe8..e37f4ff68c244cf5d1093682e4c565e2e472aec0 100644 (file)
@@ -104,11 +104,20 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
 
     What is sticking out of the note head (eg. a flag), doesn't get
     the full amount of space.
+
+    FIXED also includes the left part of the right object.
   */
-  *fixed = left_head_wid.empty_b () ? increment : left_head_wid[RIGHT];
-  *space = (base_space - increment) + *fixed +
-    (extents[LEFT][RIGHT]
-     - (left_head_wid.empty_b () ? 0.0 : left_head_wid[RIGHT]))/ 2;
+  *fixed =
+    (left_head_wid.empty_b () ? increment : left_head_wid[RIGHT])
+    + (extents[RIGHT].empty_b() ?  0.0 : - extents[RIGHT][LEFT] / 2);
+
+  /*
+    We don't do complicated stuff: (base_space - increment) is the
+    normal amount of white, which also determines the amount of
+    stretch. Upon (extreme) stretching, notes with accidentals should
+    stretch as much as notes without accidentals.
+   */
+  *space = (base_space - increment) + *fixed ;
 
   if (Item::breakable_b (right_col)
       || right_col->original_)
@@ -122,19 +131,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col,
       *space += -extents[RIGHT][LEFT];
       *fixed += -extents[RIGHT][LEFT];
     }
-  else if (*space - *fixed < 2 * ((- extents[RIGHT][LEFT]) >? 0))
-    {
-      /*
-    
-      What's sticking out at the left of the right side has less
-      influence. We only take it into account if there is not enough
-      space.
-
-      this sucks: this criterion is discontinuous; FIXME.
-      */
-      *space += 0.5 * (( -extents[RIGHT][LEFT]) >? 0);
-    }
-
+  
   stem_dir_correction (me, right_col, increment, space, fixed);
 }