]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lookup.cc
Issue 4954/1: Change spanner-id to be a key instead of a string
[lilypond.git] / lily / lookup.cc
index 35aa926720f979f812fde1f0ec04b3a4f6ab1976..3e592516c588bc765cdfe451931bd56da2122e8b 100644 (file)
@@ -246,9 +246,9 @@ Lookup::round_filled_polygon (vector<Offset> const &points,
      applies to the given polygon.  However, this is quite complicated
      to check. */
 
+#ifdef DEBUG
   const Real epsilon = 0.01;
 
-#ifdef DEBUG
   /* remove consecutive duplicate points */
   for (vsize i = 0; i < points.size (); i++)
     {
@@ -547,7 +547,7 @@ Stencil
 Lookup::repeat_slash (Real w, Real s, Real t)
 {
 
-  Real x_width = sqrt ((t * t) + ((t / s) * (t / s)));
+  Real x_width = hypot (t, t/s);
   Real height = w * s;
 
   SCM controls = scm_list_n (ly_symbol2scm ("moveto"),
@@ -573,8 +573,8 @@ Lookup::repeat_slash (Real w, Real s, Real t)
                                SCM_BOOL_T,
                                SCM_UNDEFINED);
 
-  Box b (Interval (0, w + sqrt (sqr (t / s) + sqr (t))),
-         Interval (0, w * s));
+  Box b (Interval (0, w + x_width),
+         Interval (0, height));
 
   return Stencil (b, slashnodot); //  http://slashnodot.org
 }
@@ -583,7 +583,7 @@ Stencil
 Lookup::bracket (Axis a, Interval iv, Real thick, Real protrude, Real blot)
 {
   Box b;
-  Axis other = Axis ((a + 1) % 2);
+  Axis other = other_axis (a);
   b[a] = iv;
   b[other] = Interval (-1, 1) * thick * 0.5;