mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Simplify BezierTool example.
This commit is contained in:
parent
d67953c1da
commit
0bc1a9aac6
1 changed files with 8 additions and 14 deletions
|
@ -59,20 +59,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseDrag(event) {
|
function onMouseDrag(event) {
|
||||||
if (mode == 'move') {
|
if (mode == 'move' && type == 'point') {
|
||||||
if (type == 'point') {
|
currentSegment.point = event.point;
|
||||||
currentSegment.point = event.point;
|
} else if (mode != 'close') {
|
||||||
} else {
|
var delta = event.delta.clone();
|
||||||
var delta = event.delta.clone();
|
if (type == 'handleOut' || mode == 'add')
|
||||||
if (type == 'handleOut')
|
delta = -delta;
|
||||||
delta = -delta;
|
currentSegment.handleIn += delta;
|
||||||
currentSegment.handleIn += delta;
|
currentSegment.handleOut -= delta;
|
||||||
currentSegment.handleOut -= delta;
|
|
||||||
}
|
|
||||||
} else if (mode == 'add') {
|
|
||||||
var delta = event.point - event.downPoint;
|
|
||||||
currentSegment.handleOut = delta;
|
|
||||||
currentSegment.handleIn = -delta;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue