]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-column.cc
Doc: NR - Pitches.itely - dodecaphonic-no-repeat text alt
[lilypond.git] / lily / note-column.cc
index 867542bdbd39fe497b6da103e66572e5840ddf4c..625bed1b2f4cbc27fc507c2be414a2066cae7be9 100644 (file)
@@ -156,6 +156,26 @@ Note_column::first_head (Grob *me)
   return st ? Stem::first_head (st) : 0;
 }
 
+/*
+  Return extent of the noteheads in the "main column",
+  i.e. excluding any suspended noteheads.
+*/
+Interval
+Note_column::calc_main_heads_extent (Grob *me)
+{
+  if (get_stem (me))
+    return first_head (me)->extent (me, X_AXIS);
+  else
+    {
+      // no stems => no suspended noteheads.
+      extract_grob_set (me, "note-heads", heads);
+      if (heads.size())
+        return heads[0]->extent (me, X_AXIS);
+      else
+        return Interval (0, 0);
+    }
+}
+
 /*
   Return the first AccidentalPlacement grob that we find in a note-head.
 */