mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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,
|
count: 34,
|
||||||
points: 32
|
points: 32
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var i = 0; i < values.count; i++) {
|
for (var i = 0; i < values.count; i++) {
|
||||||
var offset = new Point(20 + 10 * i, 0);
|
var offset = new Point(20 + 10 * i, 0);
|
||||||
var path = new Path();
|
var path = new Path();
|
||||||
path.fillColor = i % 2 ? 'red' : 'black';
|
path.fillColor = i % 2 ? 'red' : 'black';
|
||||||
path.closed = true;
|
path.closed = true;
|
||||||
|
|
||||||
var l = offset.length;
|
var l = offset.length;
|
||||||
for (var j = 0; j < values.points * 2; j++) {
|
for (var j = 0; j < values.points * 2; j++) {
|
||||||
offset.angle += 360 / values.points;
|
offset.angle += 360 / values.points;
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
item.rotate(angle);
|
item.rotate(angle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reposition the paths whenever the window is resized:
|
// Reposition the paths whenever the window is resized:
|
||||||
function onResize(event) {
|
function onResize(event) {
|
||||||
project.activeLayer.position = view.center;
|
project.activeLayer.position = view.center;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
var mousePos = position;
|
var mousePos = position;
|
||||||
var children = project.activeLayer.children;
|
var children = project.activeLayer.children;
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
function iterate() {
|
function iterate() {
|
||||||
count++;
|
count++;
|
||||||
var delta = (mousePos - position);
|
var delta = (mousePos - position);
|
||||||
|
@ -35,11 +35,11 @@
|
||||||
path.fillColor.hue = count - length;
|
path.fillColor.hue = count - length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFrame() {
|
function onFrame() {
|
||||||
iterate();
|
iterate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseMove(event) {
|
function onMouseMove(event) {
|
||||||
iterate();
|
iterate();
|
||||||
mousePos = event.point;
|
mousePos = event.point;
|
||||||
|
|
Loading…
Reference in a new issue