]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh://jneem@git.sv.gnu.org/srv/git/lilypond
authorJoe Neeman <joeneeman@gmail.com>
Sat, 17 May 2008 11:30:01 +0000 (21:30 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sat, 17 May 2008 11:30:01 +0000 (21:30 +1000)
input/regression/collision-seconds.ly [new file with mode: 0644]
input/regression/ottava-edge.ly [new file with mode: 0644]
lily/note-collision.cc
lily/ottava-bracket.cc

diff --git a/input/regression/collision-seconds.ly b/input/regression/collision-seconds.ly
new file mode 100644 (file)
index 0000000..812f986
--- /dev/null
@@ -0,0 +1,10 @@
+\version "2.11.44"
+
+\header {
+  texidoc = "Seconds do not confuse the collision algorithm too much. The best
+way to format this would be to merge the two Ds, but we will be happy for now
+if the upstem D does not collide with the downstem C."
+}
+
+
+<< d' \\ <c' d'> >>
diff --git a/input/regression/ottava-edge.ly b/input/regression/ottava-edge.ly
new file mode 100644 (file)
index 0000000..314d5f9
--- /dev/null
@@ -0,0 +1,43 @@
+
+\header
+{
+  texidoc = 
+  "Both edge heights of an ottava bracket can be specified."
+}
+\version "2.11.45"
+
+
+\layout { ragged-right = ##t} 
+
+\relative c'''  {
+
+  %standard ottavation
+  #(set-octavation 1)
+  a b c
+  #(set-octavation 0)
+  a
+  
+  %override the left edge height to produce standard text with a left edge
+  #(set-octavation 1)
+  \once \override Staff.OttavaBracket #'edge-height = #'(1.2 . 1.2)
+  a b c
+  #(set-octavation 0)
+  a
+  
+  % Look! we can make them go up!
+  #(set-octavation 1)
+  \once \override Staff.OttavaBracket #'edge-height = #'(-1 . -1)
+  a b c
+  #(set-octavation 0)
+  a
+  
+  % and have them go in different directions
+  #(set-octavation 1)
+  \once \override Staff.OttavaBracket #'edge-height = #'(-1.2 . 1.2)
+  a b c
+  #(set-octavation 0)
+  a
+}
+
+
index 894f16071fa5d5e76e0d2101ffe4a897e47c13b3..7abcc2acc9c7bc4f0e94905747bfb3d767c4576c 100644 (file)
@@ -161,6 +161,13 @@ check_meshing_chords (Grob *me,
   Real shift_amount = 1;
 
   bool touch = (ups[0] >= dps.back ());
+  /* As a special case, if the topmost part of the downstem chord is a second,
+     the top note of which is the same pitch as the lowest upstem note, they
+     shouldn't count as touching.
+  */
+  if (dps.back () == ups[0] && dps.size () > 1 && dps[dps.size() - 2] == ups[0] - 1)
+    touch = false;
+
   if (touch)
     shift_amount *= -1;
 
index a2ed6b54227bdb2c85f493f0d3daa44b44b43bad..82218145315cfc32cdd3b5c01b2694a130c45c6e 100644 (file)
@@ -132,10 +132,13 @@ Ottava_bracket::print (SCM smob)
   Drul_array<Real> flare = robust_scm2interval (me->get_property ("bracket-flare"),
                                                Interval (0, 0));
 
-  edge_height[LEFT] = 0.0;
-  edge_height[RIGHT] *= -get_grob_direction (me);
-  if (broken[RIGHT])
-    edge_height[RIGHT] = 0.0;
+  do
+    {
+      edge_height[d] *= -get_grob_direction (me);
+      if (broken[d])
+       edge_height[d] = 0.0;
+    }
+  while (flip(&d) != LEFT);
 
   Stencil b;
   Interval empty;