From: David Kastrup Date: Wed, 2 Mar 2016 21:15:34 +0000 (+0100) Subject: Some code cleanup in lookup.cc X-Git-Tag: release/2.19.38-1~6^2~2 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;ds=sidebyside;h=6c6ab00cbc5bff76f5ff56466b8eda4d448d0339;p=lilypond.git Some code cleanup in lookup.cc Nothing comprehesive or systematic. --- diff --git a/lily/lookup.cc b/lily/lookup.cc index 35aa926720..b6d13fc356 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -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;