From 308ece7d1cb4fdffff52925f0bac24a5ee8d1332 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Sat, 8 Sep 2007 19:31:10 +1000 Subject: [PATCH] Fix 377. --- lily/bar-line.cc | 16 ++++++++++++++++ lily/include/bar-line.hh | 1 + lily/span-bar.cc | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 48b9c4715d..2136571ed4 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -16,6 +16,22 @@ #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) diff --git a/lily/include/bar-line.hh b/lily/include/bar-line.hh index d85905d72e..ce22353c8d 100644 --- a/lily/include/bar-line.hh +++ b/lily/include/bar-line.hh @@ -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)); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 993fafe14a..4c9142139f 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -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); -- 2.39.2