+ if the middle of the space found is not low/high
+ enough, take the next space (if there are no more
+ spaces, ydim won't be enlarged further).
+ */
+ std::vector<Real>::const_iterator it
+ = std::lower_bound (line_pos.begin (), line_pos.end (),
+ ydim[DOWN]);
+ assert (line_pos.begin () < it);
+ double val = (it[-1] + it[0]) / 2;
+ if (ydim[DOWN] < val && line_pos.begin () < it - 1)
+ val = (it[-2] + it[-1]) / 2;
+ ydim.add_point (val);
+
+ it = std::upper_bound (line_pos.begin (), line_pos.end (),
+ ydim[UP]);
+ assert (it < line_pos.end ());
+ val = (it[-1] + it[0]) / 2;
+ if (val < ydim[UP] && it + 1 < line_pos.end ())
+ val = (it[0] + it[1]) / 2;
+ ydim.add_point (val);
+ }
+ }
+ }
+
+ ydim *= Staff_symbol_referencer::staff_space (me) / 2;
+
+ Interval xdim (0, thickness);
+ Box b (xdim, ydim);
+ Stencil out = Lookup::round_filled_box (b, blotdiameter);
+ return out.smobbed_copy ();
+}
+
+/*
+ Gregorian chant divisio maxima.
+*/
+MAKE_SCHEME_CALLBACK (Breathing_sign, divisio_maxima, 1);
+SCM
+Breathing_sign::divisio_maxima (SCM smob)
+{
+ Grob *me = unsmob<Grob> (smob);
+ Real staff_space = Staff_symbol_referencer::staff_space (me);
+ Real thickness = Staff_symbol_referencer::line_thickness (me);
+ thickness *= robust_scm2double (me->get_property ("thickness"), 1.0);
+
+ Real blotdiameter = me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"));
+
+ // like a "|" type bar
+ Interval xdim (0, thickness);
+ Interval ydim = Staff_symbol_referencer::staff_span (me);
+ ydim *= staff_space / 2;
+ Box b (xdim, ydim);
+ Stencil out = Lookup::round_filled_box (b, blotdiameter);
+ return out.smobbed_copy ();