X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fline-interface.cc;h=bc0895339fea3c996e08a71891c0090cbea2e96c;hb=f37b3926c57080a0dedf60727c3e8fb924112468;hp=056587a1d9863f3049a207d66ff4d0cee2b13e8e;hpb=e8d5061834a5a658c5ffd078237e9cd660069a7d;p=lilypond.git diff --git a/lily/line-interface.cc b/lily/line-interface.cc index 056587a1d9..bc0895339f 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -30,7 +30,7 @@ Line_interface::make_arrow (Offset begin, Offset end, Real thick, Real length, Real width) { - Real angle = (end - begin).arg (); + Offset dir = (end - begin).direction (); vector points; points.push_back (Offset (0, 0)); @@ -38,7 +38,7 @@ Line_interface::make_arrow (Offset begin, Offset end, points.push_back (Offset (-length, -width)); for (vsize i = 0; i < points.size (); i++) - points[i] = points[i] * complex_exp (Offset (0, angle)) + end; + points[i] = points[i] * dir + end; return Lookup::round_filled_polygon (points, thick); } @@ -70,7 +70,7 @@ Line_interface::make_trill_line (Grob *me, } while (len + elt_len < dz.length ()); - line.rotate (dz.arg (), Offset (LEFT, CENTER)); + line.rotate (dz.angle_degrees (), Offset (LEFT, CENTER)); line.translate (from); return line; @@ -95,7 +95,7 @@ Line_interface::make_zigzag_line (Grob *me, Real l = robust_scm2double (me->get_property ("zigzag-length"), 1) * w; Real h = l > w / 2 ? sqrt (l * l - w * w / 4) : 0; - Offset rotation_factor = complex_exp (Offset (0, dz.arg ())); + Offset rotation_factor = dz.direction (); Offset points[3]; points[0] = Offset (0, -h / 2); @@ -123,8 +123,8 @@ Line_interface::make_dashed_line (Real thick, Offset from, Offset to, Real dash_period, Real dash_fraction) { dash_fraction = min (max (dash_fraction, 0.0), 1.0); - Real on = dash_fraction * dash_period + thick; - Real off = max (0.0, dash_period - on); + Real on = dash_fraction * dash_period; + Real off = max (0.0, dash_period - on - thick); SCM at = scm_list_n (ly_symbol2scm ("dashed-line"), scm_from_double (thick),