]> git.donarmstrong.com Git - lilypond.git/commitdiff
(shift_region_to_valid): divide by zero fix. This
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Aug 2005 14:46:00 +0000 (14:46 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Aug 2005 14:46:00 +0000 (14:46 +0000)
fixes beams with a single stem (eg. beams across linebreaks.)

ChangeLog
lily/beam.cc
lily/spacing-engraver.cc
lily/spacing-spanner.cc
ly/engraver-init.ly
scm/define-grobs.scm

index 0a9c37ee4ca2305767ce0b6ff7652e1b5a02edb4..97ae6c0cd24c69ce543c8c3f73bb948f64d1ea75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-08-04  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/beam.cc (shift_region_to_valid): divide by zero fix. This
+       fixes beams with a single stem (eg. beams across linebreaks.)
+
        * lily/parser.yy (simple_string): allow \new STRING_IDENTIFIER.
 
        * flower/rational.cc (operator +): prevent overflow. This fixes
index a7c9a61e718ea60ff4f92e96b7eae681119ccc11..38120cd681156f9038f67e53cf069cadfd4795d0 100644 (file)
@@ -941,7 +941,7 @@ Beam::shift_region_to_valid (SCM grob)
 
   Real dy = pos[RIGHT] - pos[LEFT];
   Real y = pos[LEFT];
-  Real slope = dy / dx;
+  Real slope = dx ? (dy / dx) : 0.0;
 
   /*
     Shift the positions so that we have a chance of finding good
index d74991cfd2181baa458c556044df60ab35f9c0e8..cc4b3f39c8e462b1ccc27d7c8f13bdb727151f43 100644 (file)
@@ -145,7 +145,6 @@ Spacing_engraver::stop_translation_timestep ()
      return; 
    }
   
-  
   Moment shortest_playing;
   shortest_playing.set_infinite (1);
   for (int i = 0; i < playing_durations_.size (); i++)
index 80a4511a79bc5cf33e3d86e887cd7398628d61f4..108454d63e5d77666264b17b1b04861c33445667 100644 (file)
@@ -414,6 +414,11 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r,
       compound_fixed /= wish_count;
     }
 
+  if (options->uniform_ && l->break_status_dir () != RIGHT)
+    {
+      compound_fixed = 0.0;
+    }
+  
   assert (!isinf (compound_space));
   compound_space = max (compound_space, compound_fixed);
 
index 358400bc4baea375a8d25a84f6915fe8d7e717d1..3cb645460e666abac97ce1b728e77eae0f2909d2 100644 (file)
@@ -116,16 +116,14 @@ contained staves are not connected vertically."
 \context{
   \type "Engraver_group_engraver"
   
-  \consists "Output_property_engraver" 
-
   minimumVerticalExtent = ##f
   extraVerticalExtent = ##f
   verticalExtent = ##f 
   localKeySignature = #'()
+  createSpacing = ##t
 
-  \consists "Pitch_squash_engraver"
+  
   squashedPosition = #0
-  \consists "Separating_line_group_engraver"   
   \name RhythmicStaff
   \alias "Staff"
   
@@ -135,19 +133,25 @@ contained staves are not connected vertically."
   \override StaffSymbol #'line-count = #1      
 
   \override Stem  #'neutral-direction = #1
-  \override Beam  #'neutral-direction = #1     
-  %%   \consists "Repeat_engraver"
-  \consists "Dot_column_engraver"
+  \override Beam  #'neutral-direction = #1
+  
+  \consists "Output_property_engraver"
+  \consists "Font_size_engraver"
   \consists "Volta_engraver"
+  \consists "Separating_line_group_engraver"   
+  \consists "Dot_column_engraver"
   \consists "Bar_engraver"
-  \consists "Time_signature_engraver"
-  \consists "Staff_symbol_engraver"
   \consists "Ledger_line_engraver" 
+  \consists "Staff_symbol_engraver"
+  \consists "Pitch_squash_engraver"
+  \consists "Time_signature_engraver"
   \consists "Instrument_name_engraver"
   \consists "Axis_group_engraver"
+  
   \accepts "Voice"
   \accepts "CueVoice"
   \defaultchild "Voice"
+
   \description  "
     A context like @code{Staff} but for printing rhythms.  Pitches are
     ignored; the notes are printed on one line.  
index 29e471b7ec7274b05ed012328e0984e442b34897..978ccdd9d47d27786945051aa85e440dd9f6fc99 100644 (file)
        (space-alist . (
                        (custos . (extra-space . 0.0))
                        (ambitus . (extra-space . 2.0))
-                       (time-signature . (extra-space . 0.0))
+                       (time-signature . (extra-space . 1.0))
                        (staff-bar . (extra-space . 0.0))
                        (breathing-sign . (minimum-space . 0.0))
                        (clef . (extra-space . 0.8))
-                       (first-note . (fixed-space . 1.0))
+                       (first-note . (fixed-space . 2.0))
                        (right-edge . (extra-space . 0.0))
                        (key-signature . (extra-space . 0.0))
                        (key-cancellation . (extra-space . 0.0))