From 5e6630a1f39ccf3cbd48b485e9f5091e72000ba8 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 23 Apr 2011 15:56:27 +0200 Subject: [PATCH] Speed up drawHandle function. --- src/path/Path.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index 33d64adb..b236e901 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -305,13 +305,14 @@ var Path = this.Path = PathItem.extend({ function drawHandle(ctx, point, handle) { if (!handle.isZero()) { - handle = handle.add(point); + var handleX = point._x + handle._x, + handleY = point._y + handle._y; ctx.beginPath(); ctx.moveTo(point._x, point._y); - ctx.lineTo(handle.x, handle.y); + ctx.lineTo(handleX, handleY); ctx.stroke(); ctx.beginPath(); - ctx.rect(handle.x - 1, handle.y - 1, 2, 2); + ctx.rect(handleX - 1, handleY - 1, 2, 2); ctx.stroke(); } }