From aa1f2196c9845e5304732bf01b9a335ec64b3c5f Mon Sep 17 00:00:00 2001 From: iconexperience Date: Fri, 12 Feb 2016 14:41:21 +0100 Subject: [PATCH] Shortcut Curve.evaluate() for t === 1 to avoid imprecision. --- src/path/Curve.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 82d9ca46..a2556dcd 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1338,8 +1338,8 @@ new function() { // Scope for methods that require private functions if (type === 0) { // type === 0: getPoint() // Calculate the curve point at parameter value t - x = ((ax * t + bx) * t + cx) * t + p1x; - y = ((ay * t + by) * t + cy) * t + p1y; + x = t === 1 ? p2x : ((ax * t + bx) * t + cx) * t + p1x; + y = t === 1 ? p2y : ((ay * t + by) * t + cy) * t + p1y; } else { // type === 1: getTangent() // type === 2: getNormal()