]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/slur.cc
release: 1.1.48
[lilypond.git] / lily / slur.cc
index 5d04e5fae87775741b1b40c4a73ee96348e75e19..580974a888e19eac864cceab4a0201a1120f38f1 100644 (file)
@@ -316,28 +316,34 @@ Slur::get_encompass_offset_arr () const
   int first = 1;
   int last = encompass_arr_.size () - 1;
 
+
+  Array<Offset> notes;
+  notes.push (Offset (0,0));
+
   // prebreak
   if (broken_edge_b (RIGHT))
     last++;
-
+  else
+    {
+      Encompass_info info (encompass_arr_.top (), dir_, this);
+      d[Y_AXIS] += info.interstaff_f_;
+    }
+  
   // postbreak
   if (broken_edge_b (LEFT))
     first--;
+  else
+    {
+      Encompass_info info (encompass_arr_[0], dir_, this);
+      notes[0][Y_AXIS] += info.interstaff_f_;
+    }
 
-  Array<Offset> notes;
-  notes.push (Offset (0,0));
-
-  Real dy =0.0;
-  for (int i = 0; i < last; i++)
+  for (int i = first; i < last; i++)
     {
       Encompass_info info (encompass_arr_[i], dir_, this);
-      if (i >= first)
-       notes.push (info.o_ - left);
-      else
-       dy = info.interstaff_f_;
+      notes.push (info.o_ - left);
     }
 
-  notes[0][Y_AXIS] += dy;
   notes.push (d);
   
   return notes;