]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 482.
authorJoe Neeman <joeneeman@gmail.com>
Mon, 1 Oct 2007 08:26:44 +0000 (18:26 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 1 Oct 2007 11:47:14 +0000 (21:47 +1000)
lily/bar-line.cc
lily/include/bar-line.hh
scm/define-grob-properties.scm
scm/define-grobs.scm

index 369e3d779d8639a48e3175df3d55586172680369..800c138c9362e2231ee570497e3245a4e8e5ee41 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 ();
+    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;
@@ -317,6 +325,7 @@ ADD_INTERFACE (Bar_line,
               "glyph "
               "glyph-name "
               "bar-size "
+              "bar-extent "
               );
 
 
index ce22353c8d4934e656febec388536d3d2b6662a6..ea9833bc342fa1262a2ddb6436c4522c89d6cfa8 100644 (file)
@@ -19,6 +19,7 @@ public:
   static Stencil compound_barline (Grob *, string, Real height, bool rounded);
   static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
   static Interval bar_y_extent (Grob *, Grob *);
+  DECLARE_SCHEME_CALLBACK (calc_bar_extent, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_anchor, (SCM));
index 0b38ad9e5c630e0acc1d19a34e9be6df604655e5..07d52c41611f93f32017871a3c5e8592cabce4b7 100644 (file)
@@ -604,6 +604,9 @@ function is to protect objects from being garbage collected.")
      (axis-group-parent-X ,ly:grob? "Containing X@tie{}axis group.")
      (axis-group-parent-Y ,ly:grob? "Containing Y@tie{}axis group.")
 
+     (bar-extent ,number-pair? "The Y-extent of the actual barline.
+This may differ from 'Y-extent because it does not include the dots in
+a repeat barline.")
      (bars ,ly:grob-array? "A list of bar line pointers.")
      (beam ,ly:grob? "A pointer to the beam, if applicable.")
      (bounded-by-me ,ly:grob-array? "A list of spanners that have this
index ccbf965fcbb184dc9fedd4645c21b6dd7aa353a1..4609a7ca58ea7a49f51b5bef00a8ade078ce7e56 100644 (file)
        (stencil . ,ly:bar-line::print)
        (glyph-name . ,bar-line::calc-glyph-name)
        (bar-size .  ,ly:bar-line::calc-bar-size)
+       (bar-extent . ,ly:bar-line::calc-bar-extent)
        (allow-span-bar . #t)
        
        (space-alist . (
        (non-musical . #t)
        (stencil . ,ly:span-bar::print)
        (bar-size . ,ly:span-bar::calc-bar-size)
+       (bar-extent . ,ly:axis-group-interface::height)
        (X-extent . ,ly:span-bar::width)
        (glyph-name . ,ly:span-bar::calc-glyph-name)
        (before-line-breaking . ,ly:span-bar::before-line-breaking)
+       (allow-span-bar . #t)
 
        ;; ugh duplication!