mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Improve Chain example.
This commit is contained in:
parent
7a266a50dd
commit
bae5589409
1 changed files with 1 additions and 2 deletions
|
@ -20,14 +20,13 @@
|
||||||
strokeWidth: 20,
|
strokeWidth: 20,
|
||||||
strokeCap: 'round'
|
strokeCap: 'round'
|
||||||
});
|
});
|
||||||
var segments = path.segments;
|
|
||||||
|
|
||||||
var start = view.center / [10, 1];
|
var start = view.center / [10, 1];
|
||||||
for (var i = 0; i < points; i++)
|
for (var i = 0; i < points; i++)
|
||||||
path.add(start + new Point(i * length, 0));
|
path.add(start + new Point(i * length, 0));
|
||||||
|
|
||||||
function onMouseMove(event) {
|
function onMouseMove(event) {
|
||||||
segments[0].point = event.point;
|
path.firstSegment.point = event.point;
|
||||||
for (var i = 0; i < points - 1; i++) {
|
for (var i = 0; i < points - 1; i++) {
|
||||||
var segment = path.segments[i];
|
var segment = path.segments[i];
|
||||||
var nextSegment = segment.next;
|
var nextSegment = segment.next;
|
||||||
|
|
Loading…
Reference in a new issue