mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Speed up drawHandle function.
This commit is contained in:
parent
36ba812f39
commit
5e6630a1f3
1 changed files with 4 additions and 3 deletions
|
@ -305,13 +305,14 @@ var Path = this.Path = PathItem.extend({
|
||||||
|
|
||||||
function drawHandle(ctx, point, handle) {
|
function drawHandle(ctx, point, handle) {
|
||||||
if (!handle.isZero()) {
|
if (!handle.isZero()) {
|
||||||
handle = handle.add(point);
|
var handleX = point._x + handle._x,
|
||||||
|
handleY = point._y + handle._y;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(point._x, point._y);
|
ctx.moveTo(point._x, point._y);
|
||||||
ctx.lineTo(handle.x, handle.y);
|
ctx.lineTo(handleX, handleY);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.rect(handle.x - 1, handle.y - 1, 2, 2);
|
ctx.rect(handleX - 1, handleY - 1, 2, 2);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue