mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -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
|
// points for largely improved performance, as no calls to
|
||||||
// Point.read() and Point constructors are necessary.
|
// Point.read() and Point constructors are necessary.
|
||||||
var point = segment._point,
|
var point = segment._point,
|
||||||
handleIn = segment._handleIn,
|
handleIn = segment.getHandleInIfSet(),
|
||||||
handleOut = segment._handleOut,
|
handleOut = segment.getHandleOutIfSet(),
|
||||||
x = point.x,
|
x = point.x,
|
||||||
y = point.y;
|
y = point.y;
|
||||||
if (handleIn.isZero())
|
|
||||||
handleIn = null;
|
|
||||||
if (handleOut.isZero())
|
|
||||||
handleOut = null;
|
|
||||||
coords[0] = x;
|
coords[0] = x;
|
||||||
coords[1] = y;
|
coords[1] = y;
|
||||||
var index = 2;
|
var index = 2;
|
||||||
|
@ -370,7 +366,8 @@ var Path = this.Path = PathItem.extend({
|
||||||
point = segment._point,
|
point = segment._point,
|
||||||
x = point.x,
|
x = point.x,
|
||||||
y = point.y,
|
y = point.y,
|
||||||
handleIn = segment._handleIn;
|
handleIn = segment._handleIn,
|
||||||
|
handleOut = segment._handleOut;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
ctx.moveTo(x, y);
|
ctx.moveTo(x, y);
|
||||||
} else {
|
} else {
|
||||||
|
@ -384,7 +381,6 @@ var Path = this.Path = PathItem.extend({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handleOut = segment._handleOut;
|
|
||||||
outX = handleOut.x + x;
|
outX = handleOut.x + x;
|
||||||
outY = handleOut.y + y;
|
outY = handleOut.y + y;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue