mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Clean up white-space.
This commit is contained in:
parent
3dd2d8e8ff
commit
5f00c02e67
1 changed files with 17 additions and 17 deletions
|
@ -67,28 +67,28 @@
|
|||
for (var i = 0; i < this.numSegment; i ++) {
|
||||
if (this.boundOffset[i] < this.radius / 4)
|
||||
this.boundOffset[i] = this.radius / 4;
|
||||
var next = (i + 1) % this.numSegment;
|
||||
var prev = (i > 0) ? i - 1 : this.numSegment - 1;
|
||||
var offset = this.boundOffset[i];
|
||||
offset += (this.radius - offset) / 15;
|
||||
offset += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - offset) / 3;
|
||||
this.boundOffsetBuff[i] = this.boundOffset[i] = offset;
|
||||
}
|
||||
var next = (i + 1) % this.numSegment;
|
||||
var prev = (i > 0) ? i - 1 : this.numSegment - 1;
|
||||
var offset = this.boundOffset[i];
|
||||
offset += (this.radius - offset) / 15;
|
||||
offset += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - offset) / 3;
|
||||
this.boundOffsetBuff[i] = this.boundOffset[i] = offset;
|
||||
}
|
||||
},
|
||||
|
||||
react: function(b) {
|
||||
var dist = this.point.getDistance(b.point);
|
||||
if (dist < this.radius + b.radius && dist != 0) {
|
||||
var dist = this.point.getDistance(b.point);
|
||||
if (dist < this.radius + b.radius && dist != 0) {
|
||||
var overlap = this.radius + b.radius - dist;
|
||||
var direc = (this.point - b.point).normalize(overlap * 0.015);
|
||||
this.vector += direc;
|
||||
b.vector -= direc;
|
||||
var direc = (this.point - b.point).normalize(overlap * 0.015);
|
||||
this.vector += direc;
|
||||
b.vector -= direc;
|
||||
|
||||
this.calcBounds(b);
|
||||
b.calcBounds(this);
|
||||
this.updateBounds();
|
||||
b.updateBounds();
|
||||
}
|
||||
this.calcBounds(b);
|
||||
b.calcBounds(this);
|
||||
this.updateBounds();
|
||||
b.updateBounds();
|
||||
}
|
||||
},
|
||||
|
||||
getBoundOffset: function(b) {
|
||||
|
|
Loading…
Reference in a new issue