mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
WineGum example: Untangle the offset calculation code a bit.
This commit is contained in:
parent
e23948f90d
commit
46bd6c9b3f
1 changed files with 4 additions and 2 deletions
|
@ -68,8 +68,10 @@
|
||||||
this.boundOffset[i] = this.radius / 4;
|
this.boundOffset[i] = this.radius / 4;
|
||||||
var next = (i + 1) % this.numSegment;
|
var next = (i + 1) % this.numSegment;
|
||||||
var prev = (i > 0) ? i - 1 : this.numSegment - 1;
|
var prev = (i > 0) ? i - 1 : this.numSegment - 1;
|
||||||
this.boundOffsetBuff[i] = this.boundOffset[i] += (this.radius - this.boundOffset[i]) / 15;
|
var offset = this.boundOffset[i];
|
||||||
this.boundOffsetBuff[i] = this.boundOffset[i] += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - this.boundOffset[i]) / 3;
|
offset += (this.radius - offset) / 15;
|
||||||
|
offset += ((this.boundOffset[next] + this.boundOffset[prev]) / 2 - offset) / 3;
|
||||||
|
this.boundOffsetBuff[i] = this.boundOffset[i] = offset;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue