From 7bea7e36de917bd27e693d558dc079a0f366a5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 6 Mar 2011 11:04:41 +0000 Subject: [PATCH] Make use of new Segment#getHandleIn/OutIfSet() where we can. --- src/path/Path.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index e87b3b6d..394bbfa9 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -95,14 +95,10 @@ var Path = this.Path = PathItem.extend({ // points for largely improved performance, as no calls to // Point.read() and Point constructors are necessary. var point = segment._point, - handleIn = segment._handleIn, - handleOut = segment._handleOut, + handleIn = segment.getHandleInIfSet(), + handleOut = segment.getHandleOutIfSet(), x = point.x, y = point.y; - if (handleIn.isZero()) - handleIn = null; - if (handleOut.isZero()) - handleOut = null; coords[0] = x; coords[1] = y; var index = 2; @@ -370,7 +366,8 @@ var Path = this.Path = PathItem.extend({ point = segment._point, x = point.x, y = point.y, - handleIn = segment._handleIn; + handleIn = segment._handleIn, + handleOut = segment._handleOut; if (i == 0) { ctx.moveTo(x, y); } else { @@ -384,7 +381,6 @@ var Path = this.Path = PathItem.extend({ ); } } - handleOut = segment._handleOut; outX = handleOut.x + x; outY = handleOut.y + y; }