#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)
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));
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);