]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-symbol.cc
Release: bump Welcome versions.
[lilypond.git] / lily / staff-symbol.cc
index f4b18dfd78ad67e5e2c067332f36b0c130cd5605..256a9bdd0d24687ac26a63cc8cbc9a7ca2c7159e 100644 (file)
@@ -33,7 +33,7 @@ MAKE_SCHEME_CALLBACK (Staff_symbol, print, 1);
 SCM
 Staff_symbol::print (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   Spanner *sp = dynamic_cast<Spanner *> (me);
   Grob *common
     = sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS);
@@ -247,7 +247,20 @@ Staff_symbol::ledger_positions (Grob *me, int pos)
           values[i] = nearest_line + dir * (ledger_count - i) * 2;
         }
     }
-  return values;
+  // remove any ledger lines that would fall on staff lines,
+  // which can happen when ledger-extra > 0
+  vector<Real> final_values;
+  for (vector<Real>::const_iterator i = values.begin (),
+       e = values.end ();
+       i != e;
+       ++i)
+    {
+      if (find (line_positions.begin (), line_positions.end (), *i) == line_positions.end ())
+        {
+          final_values.push_back (*i);
+        }
+    }
+  return final_values;
 }
 
 int
@@ -289,7 +302,7 @@ MAKE_SCHEME_CALLBACK (Staff_symbol, height, 1);
 SCM
 Staff_symbol::height (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   Real t = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
   t *= robust_scm2double (me->get_property ("thickness"), 1.0);