Tune dash-period to end on a full dash.
--- /dev/null
+\header {
+
+ texidoc = "The period of a dashed line is adjusted such that it
+starts and ends on a full dash. "
+
+}
+
+\version "2.11.13"
+
+\layout {
+ indent = 0.0\mm
+ ragged-right = ##T
+}
+
+\relative <<
+ \new Staff {
+ \override DynamicTextSpanner #'dash-fraction = ##f
+ \setTextCresc
+ c1_\< c c1\!
+ }
+ \new Staff {
+ \override DynamicTextSpanner #'dash-period = #3
+ \override DynamicTextSpanner #'dash-fraction = #0.3
+ \setTextCresc
+ c1^\< c c1\!
+ }
+>>
Real period = Staff_symbol_referencer::staff_space (me)
* robust_scm2double (me->get_property ("dash-period"), 1.0);
- if (period < 0)
+ if (period <= 0)
return Stencil ();
+ Real len = (to-from).length();
+
+ int n = (int) rint ((len - period * fraction) / period);
+ period = ((to-from).length() - period * fraction) / n;
+
stil = make_dashed_line (thick, from, to, period, fraction);
}
else