]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bar-line.cc
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / bar-line.cc
index 2136571ed404f603034f3ad1979c9f4bb9f3a633..a0fa5587b410ef0fb22b2ea16c8f61e56249c1f3 100644 (file)
 #include "staff-symbol-referencer.hh"
 #include "line-interface.hh"
 
-/* Get the extent of just the line part of the bar (ie. excluding any
-   repeat dots) */
-Interval
-Bar_line::bar_y_extent (Grob *me, Grob *refpoint)
+MAKE_SCHEME_CALLBACK (Bar_line, calc_bar_extent, 1)
+SCM
+Bar_line::calc_bar_extent (SCM smob)
 {
+  Grob *me = unsmob_grob (smob);
+
   SCM size = me->get_property ("bar-size");
-  if (!scm_is_number (size))
-    return Interval ();
+
+  if (!scm_is_number (size)
+      || !Staff_symbol_referencer::get_staff_symbol (me))
+    return ly_interval2scm (Interval ());
 
   Real h = scm_to_double (size);
-  Interval iv (-h/2, h/2);
+  return ly_interval2scm (Interval (-h/2, h/2));
+}
+
+Interval
+Bar_line::bar_y_extent (Grob *me, Grob *refpoint)
+{
+  Interval iv = robust_scm2interval (me->get_property ("bar-extent"), Interval ());
 
   iv.translate (me->relative_coordinate (refpoint, Y_AXIS));
   return iv;
@@ -308,6 +317,7 @@ ADD_INTERFACE (Bar_line,
 
 
               /* properties */
+              "allow-span-bar "
               "gap "
               "kern "
               "thin-kern "
@@ -316,6 +326,7 @@ ADD_INTERFACE (Bar_line,
               "glyph "
               "glyph-name "
               "bar-size "
+              "bar-extent "
               );