]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/slur-scoring.cc (get_bound_info): robustness: substitute
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 19 Apr 2005 13:11:25 +0000 (13:11 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 19 Apr 2005 13:11:25 +0000 (13:11 +0000)
relative_coordinate if extent is empty.

* lily/stem.cc (width_callback): determine correct extent if flag
is not there. This fixes slur-no-flag.ly

ChangeLog
lily/slur-scoring.cc
lily/stem.cc

index cbfc6032ee7814cf8bbc7cb8307042b7d3cf6c1b..c983d113ce742b3b479db241e3fa08531011d119 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-04-19  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/slur-scoring.cc (get_bound_info): robustness: substitute
+       relative_coordinate if extent is empty.
+
+       * lily/stem.cc (width_callback): determine correct extent if flag
+       is not there. This fixes slur-no-flag.ly
+
        * lily/grace-engraver.cc (consider_change_grace_settings): new function.
        (initialize): also consider_change_grace_settings() on
        initialization. Fixes large grace notes at start of score.
index 400e08a9a82726370043aa34deb074f2c4fb8c3b..f0cebb1a73f86210785dd7c4dd98b3f0c7a451b7 100644 (file)
@@ -240,8 +240,20 @@ Slur_score_state::get_bound_info () const
          extremes[d].note_column_ = extremes[d].bound_;
          extremes[d].stem_ = Note_column::get_stem (extremes[d].note_column_);
          extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_);
-         extremes[d].stem_extent_[X_AXIS]
-           = extremes[d].stem_->extent (common_[X_AXIS], X_AXIS);
+
+         for (int a = X_AXIS; a < NO_AXES; a++)
+           {
+             Axis ax = Axis (a);
+             Interval s = extremes[d].stem_->extent (common_[ax], ax);
+             if (s.is_empty ())
+               {
+                 programming_error ("Stem has no extent in Slur_score_state");
+                 s = Interval (0,0)
+                   + extremes[d].stem_->relative_coordinate (common_[ax], ax);
+               }
+             extremes[d].stem_extent_[ax] = s; 
+           }
+         
          extremes[d].stem_extent_[Y_AXIS]
            = extremes[d].stem_->extent (common_[Y_AXIS], Y_AXIS);
          extremes[d].slur_head_
index ef65d3400229c30d4b9dd39adacc30fc7a405526..5eebd974e5cb6dfad78aa3ab55776f1c172011fc 100644 (file)
@@ -615,8 +615,8 @@ Stem::width_callback (SCM e, SCM ax)
     }
   else
     {
-      r = flag (me).extent (X_AXIS)
-       + thickness (me) / 2;
+      r = Interval (-1,1) * thickness (me) * 0.5;
+      r.unite (flag (me).extent (X_AXIS));
     }
   return ly_interval2scm (r);
 }