mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Clean up Curve Time Parametrization example.
This commit is contained in:
parent
e8a2a786e0
commit
7c51369426
1 changed files with 4 additions and 3 deletions
|
@ -14,13 +14,14 @@
|
||||||
var curve = path.curves[0];
|
var curve = path.curves[0];
|
||||||
|
|
||||||
function onMouseMove(event) {
|
function onMouseMove(event) {
|
||||||
modifyCurve(event.point, false, true);
|
modifyCurve(event.point, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function modifyCurve(point, iteratively, remove) {
|
function modifyCurve(point, remove) {
|
||||||
curve.segment2.point = point;
|
curve.segment2.point = point;
|
||||||
var length = curve.length;
|
var length = curve.length;
|
||||||
var step = 10;
|
var step = 10;
|
||||||
|
var iteratively = false;
|
||||||
var num = Math.floor(length / step);
|
var num = Math.floor(length / step);
|
||||||
var prev = 0;
|
var prev = 0;
|
||||||
for (var i = 0, pos = 0; i <= num; i++, pos += step) {
|
for (var i = 0, pos = 0; i <= num; i++, pos += step) {
|
||||||
|
@ -36,7 +37,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// modifyCurve(new Point(400, 377), false, false);
|
// modifyCurve(new Point(400, 377), false);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue