mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Clean ups.
This commit is contained in:
parent
cfe968d30e
commit
378952666a
2 changed files with 6 additions and 6 deletions
|
@ -13,13 +13,13 @@
|
|||
count: 34,
|
||||
points: 32
|
||||
};
|
||||
|
||||
|
||||
for (var i = 0; i < values.count; i++) {
|
||||
var offset = new Point(20 + 10 * i, 0);
|
||||
var path = new Path();
|
||||
path.fillColor = i % 2 ? 'red' : 'black';
|
||||
path.closed = true;
|
||||
|
||||
|
||||
var l = offset.length;
|
||||
for (var j = 0; j < values.points * 2; j++) {
|
||||
offset.angle += 360 / values.points;
|
||||
|
@ -39,7 +39,7 @@
|
|||
item.rotate(angle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Reposition the paths whenever the window is resized:
|
||||
function onResize(event) {
|
||||
project.activeLayer.position = view.center;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
var mousePos = position;
|
||||
var children = project.activeLayer.children;
|
||||
var count = 0;
|
||||
|
||||
|
||||
function iterate() {
|
||||
count++;
|
||||
var delta = (mousePos - position);
|
||||
|
@ -35,11 +35,11 @@
|
|||
path.fillColor.hue = count - length;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onFrame() {
|
||||
iterate();
|
||||
}
|
||||
|
||||
|
||||
function onMouseMove(event) {
|
||||
iterate();
|
||||
mousePos = event.point;
|
||||
|
|
Loading…
Reference in a new issue