]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/line-interface.cc
4944: Do not initialize static constants in class body (fix FTBFS on GCC 6)
[lilypond.git] / lily / line-interface.cc
index 056587a1d9863f3049a207d66ff4d0cee2b13e8e..f23b58e3084be45de601b5b04f771cf2fb4b3aab 100644 (file)
@@ -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<Offset> 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);
 }
@@ -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),