mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-28 17:02:24 -05:00
Fix errors in Boolean Operations example.
This commit is contained in:
parent
23443dc8f4
commit
5af391d333
1 changed files with 1 additions and 2 deletions
|
@ -360,10 +360,9 @@
|
|||
|
||||
function disperse(path, distance) {
|
||||
distance = distance || 10;
|
||||
if (! path instanceof CompoundPath || ! path instanceof Group) { return; }
|
||||
var center = path.bounds.center;
|
||||
var children = path.children, i ,len;
|
||||
for (var i = 0, len = children.length; i < len; i++) {
|
||||
for (var i = 0, len = children && children.length; i < len; i++) {
|
||||
var cCenter = children[i].bounds.center;
|
||||
var vec = cCenter.subtract(center);
|
||||
vec = (vec.isClose([0,0], 0.5))? vec : vec.normalize(distance);
|
||||
|
|
Loading…
Reference in a new issue