mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Make Phyllotaxis Raster example run a little less hot.
This commit is contained in:
parent
981bce31cb
commit
581f99f345
1 changed files with 3 additions and 5 deletions
|
@ -51,8 +51,8 @@
|
|||
return group;
|
||||
}
|
||||
|
||||
function colorizePaths() {
|
||||
for (var i = 0, l = group.children.length; i < l; i++) {
|
||||
function colorizePaths(offset) {
|
||||
for (var i = offset % 50, l = group.children.length; i < l; i += 50) {
|
||||
var path = group.children[i];
|
||||
// Set the path's fill color to the average color of the
|
||||
// raster pixels that fall within it:
|
||||
|
@ -86,9 +86,7 @@
|
|||
group.children[i].rotate(2);
|
||||
}
|
||||
// Colorize the paths every other frame:
|
||||
if (event.count % 2 == 0) {
|
||||
colorizePaths();
|
||||
}
|
||||
colorizePaths(event.count);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue