]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / lily / grob.cc
index 5047b35be0c0c337d45bddf338fdc49f7a5f0384..bdf338888f2c440200837c442e696a4ef50f676a 100644 (file)
@@ -191,6 +191,16 @@ Grob::get_system () const
   return 0;
 }
 
+/* This version of get_system is more reliable than this->get_system ()
+   before line-breaking has been done, at which point there is only
+   one system in the whole score and we can find it just by following
+   parent pointers. */
+System *
+Grob::get_system(Grob *me)
+{
+  Grob *p = me->get_parent (X_AXIS);
+  return p ? get_system (p) : dynamic_cast<System *>(me);
+}
 
 void
 Grob::handle_broken_dependencies ()
@@ -482,6 +492,19 @@ Grob::spanned_rank_interval () const
   return Interval_t<int> (-1, 0);
 }
 
+bool
+Grob::pure_is_visible (int /* start */, int /* end */) const
+{
+  return true;
+}
+
+/* Sort grobs according to their starting column. */
+bool
+Grob::less (Grob *g1, Grob *g2)
+{
+  return g1->spanned_rank_interval ()[LEFT] < g2->spanned_rank_interval ()[LEFT];
+}
+
 /****************************************************************
   REFPOINTS
 ****************************************************************/