]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 377.
authorJoe Neeman <joeneeman@gmail.com>
Sat, 8 Sep 2007 09:31:10 +0000 (19:31 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sat, 8 Sep 2007 09:31:10 +0000 (19:31 +1000)
lily/bar-line.cc
lily/include/bar-line.hh
lily/span-bar.cc

index 48b9c4715da6e4e09631bb7b873812b82e123ddc..2136571ed404f603034f3ad1979c9f4bb9f3a633 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)
+{
+  SCM size = me->get_property ("bar-size");
+  if (!scm_is_number (size))
+    return Interval ();
+
+  Real h = scm_to_double (size);
+  Interval iv (-h/2, h/2);
+
+  iv.translate (me->relative_coordinate (refpoint, Y_AXIS));
+  return iv;
+}
+
 MAKE_SCHEME_CALLBACK (Bar_line, print, 1);
 SCM
 Bar_line::print (SCM smob)
index d85905d72e79d6cad32a30db89ae7c55eb2c33f6..ce22353c8d4934e656febec388536d3d2b6662a6 100644 (file)
@@ -18,6 +18,7 @@ public:
   static Stencil dashed_bar_line (Grob *me, Real h, Real thick);
   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_size, (SCM));
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_anchor, (SCM));
index 993fafe14a70581aad7f852c4d53f2b806056d04..4c9142139f37ee687a5a4d5ea75091578ea2b148 100644 (file)
@@ -61,8 +61,8 @@ Span_bar::print (SCM smobbed_me)
   for (vsize i = elements.size (); i--;)
     {
       Grob *bar = elements[i];
-      Interval ext = bar->extent (refp, Y_AXIS);
-      if (ext.is_empty () || to_boolean (bar->get_property ("transparent")))
+      Interval ext = Bar_line::bar_y_extent (bar, refp);
+      if (ext.is_empty ())
        continue;
 
       extents.push_back (ext);