]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge commit 'ce4b499'
authorJoe Neeman <joeneeman@gmail.com>
Mon, 11 Feb 2008 23:30:05 +0000 (00:30 +0100)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 11 Feb 2008 23:30:05 +0000 (00:30 +0100)
input/regression/accidental-broken-tie-spacing.ly [new file with mode: 0644]
lily/accidental.cc
lily/bar-line.cc
lily/note-spacing.cc
lily/spacing-spanner.cc
lily/stem.cc
scm/define-grobs.scm

diff --git a/input/regression/accidental-broken-tie-spacing.ly b/input/regression/accidental-broken-tie-spacing.ly
new file mode 100644 (file)
index 0000000..f333f76
--- /dev/null
@@ -0,0 +1,11 @@
+\version "2.11.37"
+
+\header {
+  texidoc = "When a tie is broken, the spacing engine must consider the
+accidental after the line break, to prevent a collision from occurring."
+}
+
+{ \key g \major gis''1~ \break gis''4
+\repeat unfold 43 {d4 \noBreak} }
+
+
index afca79720e976390d13ca9beb9d61a44a6a07502..402a17e99d0d5a0326e9160d218dfc36591522eb 100644 (file)
@@ -67,7 +67,7 @@ Accidental_interface::pure_height (SCM smob, SCM start_scm, SCM)
 
   if (to_boolean (me->get_property ("forced"))
       || !unsmob_grob (me->get_object ("tie"))
-      || rank != start + 1) /* we are in the middle of a line */
+      || rank == start + 1) /* we are at the start of a line */
     {
       Stencil *s = unsmob_stencil (get_stencil (me));
       if (s)
index 800c138c9362e2231ee570497e3245a4e8e5ee41..a0fa5587b410ef0fb22b2ea16c8f61e56249c1f3 100644 (file)
@@ -24,7 +24,8 @@ Bar_line::calc_bar_extent (SCM smob)
 
   SCM size = me->get_property ("bar-size");
 
-  if (!scm_is_number (size))
+  if (!scm_is_number (size)
+      || !Staff_symbol_referencer::get_staff_symbol (me))
     return ly_interval2scm (Interval ());
 
   Real h = scm_to_double (size);
index 96f7b8f8e35078da3b53b6be2f5daa18c38d619b..ffb9d7c40ed28cecf85749e76afbce628c7ab6a2 100644 (file)
@@ -95,6 +95,8 @@ Note_spacing::get_spacing (Grob *me, Item *right_col,
   ideal = max (ideal, min_desired_space);
   stem_dir_correction (me, right_col, increment, &ideal, &min_desired_space);
 
+  /* TODO: grace notes look bad when things are stretched. Should we increase
+     their stretch strength? */
   Spring ret (max (0.0, ideal), min_dist);
   ret.set_inverse_compress_strength (max (0.0, ideal - min_desired_space));
   ret.set_inverse_stretch_strength (max (0.1, base_space - increment));
index 53d6ef278b1b4b11a468e744edbbb62fea0fd957..512bfe4166a71565a5464b42d1a42630ebf05d5b 100644 (file)
@@ -337,7 +337,16 @@ Spacing_spanner::musical_column_spacing (Grob *me,
            This is probably a waste of time in the case of polyphonic
            music.  */
          if (Note_spacing::has_interface (wish))
-           springs.push_back (Note_spacing::get_spacing (wish, right_col, base_note_space, options->increment_));
+           {
+             Real inc = options->increment_;
+             if (Grob *gsp = unsmob_grob (left_col->get_object ("grace-spacing")))
+               {
+                 Spacing_options grace_opts;
+                 grace_opts.init_from_grob (gsp);
+                 inc = grace_opts.increment_;
+               }
+             springs.push_back (Note_spacing::get_spacing (wish, right_col, base_note_space, inc));
+           }
        }
 
       if (springs.empty ())
index 6016eebbb439b7b067201225a0f7adcdd84d85b0..31311f101da06e1deecccf317c1b9162334c9d59 100644 (file)
@@ -241,6 +241,7 @@ Stem::pure_height (SCM smob, SCM start, SCM end)
     return ly_interval2scm (iv);
 
   Real ss = Staff_symbol_referencer::staff_space (me);
+  Real rad = Staff_symbol_referencer::staff_radius (me);
 
   if (!to_boolean (me->get_property ("cross-staff")))
     {
@@ -255,12 +256,15 @@ Stem::pure_height (SCM smob, SCM start, SCM end)
 
       if (!hp.is_empty ())
        iv.translate (hp[dir] * ss / 2);
-    }
 
-  /* at a minimum, make the pure-height cover the staff symbol */
-  Real rad = Staff_symbol_referencer::staff_radius (me);
-  iv.add_point (-rad * ss);
-  iv.add_point (rad * ss);
+      /* extend the stem (away from the head) to cover the staff */
+      if (dir == UP)
+       iv[UP] = max (iv[UP], rad * ss);
+      else
+       iv[DOWN] = min (iv[DOWN], -rad * ss);
+    }
+  else
+    iv = Interval (-rad * ss, rad * ss);
 
   return ly_interval2scm (iv);
 }
index 187218c6173dc545f627806720a91efee63ede76..0800d482d843f581a46f62421edb29f40c2b3727 100644 (file)
      . (
        (axes . (,Y))
        (Y-extent . ,ly:axis-group-interface::height)
+       (X-extent . ,ly:axis-group-interface::width)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (side-axis . ,Y)
        (staff-padding . 1.0)
      . (
        (axes . (,Y))
        (Y-extent . ,ly:axis-group-interface::height)
+       (X-extent . ,ly:axis-group-interface::width)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (side-axis . ,Y)
        (padding . 1.2)
      . (
        (axes . (,Y))
        (Y-extent . ,ly:axis-group-interface::height)
+       (X-extent . ,ly:axis-group-interface::width)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (side-axis . ,Y)
        (padding . 1.2)