]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-symbol.cc
Doc-es: update master file of Usage manual.
[lilypond.git] / lily / staff-symbol.cc
index e9ad096326465b9fb514eb67ce80feea972b7d17..256a9bdd0d24687ac26a63cc8cbc9a7ca2c7159e 100644 (file)
@@ -28,8 +28,6 @@
 #include "staff-symbol-referencer.hh"
 #include "spanner.hh"
 
-using std::vector;
-
 MAKE_SCHEME_CALLBACK (Staff_symbol, print, 1);
 
 SCM
@@ -249,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