-Stencil
-zigzag_stencil (Grob *me,
- Offset from,
- Offset to)
-{
- Offset dz = to -from;
- Real dx = dz[X_AXIS];
- Real dy = dz[Y_AXIS];
-
- Real thick = Staff_symbol_referencer::line_thickness (me);
- thick *= robust_scm2double (me->get_property ("thickness"), 1.0); // todo: staff sym referencer?
-
- Real staff_space = Staff_symbol_referencer::staff_space (me);
-
- double w = robust_scm2double (me->get_property ("zigzag-width"), 1) * staff_space;
- double l = robust_scm2double (me->get_property ("zigzag-length"), 1) * w;
- double h = l > w / 2 ? sqrt (l * l - w * w / 4) : 0;
-
- SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"),
- ly_bool2scm (true),
- scm_make_real (w),
- scm_make_real (h),
- scm_make_real (thick),
- scm_make_real (dx),
- scm_make_real (dy),
- SCM_UNDEFINED);
- Box b;
- b.add_point (Offset (0, 0));
- b.add_point (dz);
- b[X_AXIS].widen (thick / 2);
- b[Y_AXIS].widen (thick / 2);
-
- return Stencil (b, list);
-}
-
-MAKE_SCHEME_CALLBACK (Line_spanner, after_line_breaking, 1);
-SCM
-Line_spanner::after_line_breaking (SCM g)
-{
- Grob *me = unsmob_grob (g);
- Spanner *sp = dynamic_cast<Spanner *> (me);
-
- /*
- We remove the line at the start of the line. For piano voice
- indicators, it makes no sense to have them at the start of the
- line.
-
- I'm not sure what the official rules for glissandi are, but
- usually the 2nd note of the glissando is "exact", so when playing
- from the start of the line, there is no need to glide.
-
- From a typographical p.o.v. this makes sense, since the amount of
- space left of a note at the start of a line is very small.
-
- --hwn.
-
- */
- if (sp->get_bound (LEFT)->break_status_dir ()
- && !sp->get_bound (RIGHT)->break_status_dir ())
- {
- /*
- Can't do suicide, since this mucks up finding the trend.
- */
- me->set_property ("print-function", SCM_EOL);
- }
- return SCM_EOL;
-}