X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbezier.cc;fp=lily%2Fbezier.cc;h=38c40f3ffc00e2c4df2827408ef94c2d65aca4fd;hb=93f27c0b47b1dbacd65eacab96fb9b2f84970dc9;hp=0a0f4cfc6ff3f18962548c44bf391e9ba99762ad;hpb=05f05a51ca0078ce9a8c87cbf30ac7fbd4def706;p=lilypond.git diff --git a/lily/bezier.cc b/lily/bezier.cc index 0a0f4cfc6f..38c40f3ffc 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -254,7 +254,14 @@ Bezier::minmax (Axis ax, Real l, Real r, Direction d) const for (vsize i = solutions.size (); i--;) { Real t = solutions[i]; - if (t >= 0 && t <= 1 && p.eval (t) >= l && p.eval (t) <= r) + if (t >= 0 && t <= 1 + // FIXME: floating point comparison for equality + // Two of the t in solutions were found by solving + // p(t) = l, bzw. r, and we want this test to pass for these t, + // but it can easily fail if floating point internal precision + // differs from storage precision. + // Better to store separately the two t for which p(t) = l and r + && p.eval (t) >= l && p.eval (t) <= r) values.push_back (other_p.eval (t)); }