]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/system.cc
Fix #10.
[lilypond.git] / lily / system.cc
index 90eb463c44932ac307902bd3e8a7e5e210b7984f..5070f9426cd92506b77d97e3a9f108200f55e1ff 100644 (file)
@@ -23,6 +23,7 @@
 #include "staff-symbol-referencer.hh"
 #include "tweak-registration.hh"
 #include "warn.hh"
+#include "lookup.hh"
 
 extern bool debug_skylines;
 
@@ -245,10 +246,7 @@ System::add_column (Paper_column *p)
       ga = unsmob_grob_array (scm_ga);
     }
 
-  p->rank_
-    = ga->size ()
-    ? Paper_column::get_rank (ga->array ().back ()) + 1
-    : 0;
+  p->rank_ = ga->size ();
 
   ga->add (p);
   Axis_group_interface::add_element (this, p);
@@ -402,8 +400,8 @@ System::get_paper_system ()
                                 exprs));
   if (debug_skylines)
     {
-      sys_stencil.add_stencil (points_to_line_stencil (skylines_[UP].to_points ()).in_color (255, 0, 0));
-      sys_stencil.add_stencil (points_to_line_stencil (skylines_[DOWN].to_points ()).in_color (0, 255, 0));
+      sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, skylines_[UP].to_points ()).in_color (255, 0, 0));
+      sys_stencil.add_stencil (Lookup::points_to_line_stencil (0.1, skylines_[DOWN].to_points ()).in_color (0, 255, 0));
     }
 
   Grob *left_bound = this->get_bound (LEFT);
@@ -448,9 +446,7 @@ System::broken_col_range (Item const *left, Item const *right) const
   
   extract_grob_set (this, "columns", cols);
 
-  vsize i = binary_search (cols, (Grob *) left,
-                          Paper_column::less_than);
-
+  vsize i = Paper_column::get_rank (left);
   int end_rank = Paper_column::get_rank (right);
   if (i < cols.size ())
     i++;
@@ -493,6 +489,13 @@ System::columns () const
   return columns;
 }
 
+Grob*
+System::column (int which) const
+{
+  extract_grob_set (this, "columns", columns);
+  return columns[which];
+}
+
 Paper_score*
 System::paper_score () const
 {