mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Make use of new Segment#getHandleIn/OutIfSet() where we can.
This commit is contained in:
parent
b98abeb416
commit
7bea7e36de
1 changed files with 4 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue