]> git.donarmstrong.com Git - lilypond.git/commitdiff
Includes Flags is Slur encompass calculations
authorMike Solomon <mike@apollinemike.com>
Mon, 11 Jun 2012 05:56:42 +0000 (07:56 +0200)
committerMike Solomon <mike@apollinemike.com>
Mon, 11 Jun 2012 05:56:42 +0000 (07:56 +0200)
input/regression/slur-flag.ly [new file with mode: 0644]
lily/include/note-column.hh
lily/include/slur-scoring.hh
lily/note-column.cc
lily/slur-scoring.cc

diff --git a/input/regression/slur-flag.ly b/input/regression/slur-flag.ly
new file mode 100644 (file)
index 0000000..5c21ebb
--- /dev/null
@@ -0,0 +1,12 @@
+\version "2.15.40"
+
+\header {
+  texidoc = "Slurs take flag extents into account.
+"
+}
+
+\relative c'' {
+  \stemUp
+  \slurUp
+  b8( c)
+}
index e9f98823e17ca03f1c8e030741ffdbe33e09a80c..280a5c969f474c1c3996fe42365025a224678e19 100644 (file)
@@ -46,6 +46,7 @@ public:
   DECLARE_GROB_INTERFACE ();
 
   static Item *get_stem (Grob *);
+  static Item *get_flag (Grob *);
 };
 
 #endif // NOTE_COLUMN_HH
index 87791e0ca6c2b52efe31fb450ccd903f171283b8..4b379c09137ade2207c9edbaf7bc5e6b1b9c2503 100644 (file)
@@ -66,6 +66,7 @@ struct Bound_info
   Grob *slur_head_;
   Grob *staff_;
   Grob *stem_;
+  Grob *flag_;
   Interval slur_head_x_extent_;
   Real staff_space_;
 
index f3ff4f08d642b23816075b73c3b6893af891a054..da52093797fb1f3b98c91f42c07ad0835f70a441 100644 (file)
@@ -64,6 +64,18 @@ Note_column::get_stem (Grob *me)
   return unsmob_item (s);
 }
 
+Item *
+Note_column::get_flag (Grob *me)
+{
+  Item *stem = get_stem (me);
+  if (stem)
+    {
+      SCM s = stem->get_object ("flag");
+      return unsmob_item (s);
+    }
+  return 0;
+}
+
 Slice
 Note_column::head_positions_interval (Grob *me)
 {
index 9e50984243a9e5861dc36768e08c688797e1b3c2..e137c11f013bd3cc6728102e2f7d22574e170961 100644 (file)
@@ -165,6 +165,8 @@ 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].flag_ = Note_column::get_flag (extremes[d].note_column_);
+
           if (extremes[d].stem_)
             {
               extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_);
@@ -173,6 +175,8 @@ Slur_score_state::get_bound_info () const
                 {
                   Axis ax = Axis (a);
                   Interval s = extremes[d].stem_->extent (common_[ax], ax);
+                  if (extremes[d].flag_)
+                    s.unite (extremes[d].flag_->extent (common_[ax], ax));
                   if (s.is_empty ())
                     {
                       /*