mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Fix global variable leakage.
This commit is contained in:
parent
375156059d
commit
18383875eb
2 changed files with 4 additions and 4 deletions
|
@ -352,7 +352,7 @@
|
|||
if (! path instanceof CompoundPath || ! path instanceof Group) { return; }
|
||||
var center = path.bounds.center;
|
||||
var children = path.children, i ,len;
|
||||
for (i = 0, len = children.length; i < len; i++) {
|
||||
for (var i = 0, len = 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);
|
||||
|
@ -386,11 +386,11 @@
|
|||
function annotatePath(path, t, c, tc, remove) {
|
||||
if (!path) return;
|
||||
var crvs = path.curves;
|
||||
for (i = crvs.length - 1; i >= 0; i--) {
|
||||
for (var i = crvs.length - 1; i >= 0; i--) {
|
||||
annotateCurve(crvs[i], t, c, tc, remove);
|
||||
}
|
||||
var segs = path.segments;
|
||||
for (i = segs.length - 1; i >= 0; i--) {
|
||||
for (var i = segs.length - 1; i >= 0; i--) {
|
||||
annotateSegment(segs[i], t, c, tc, remove, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
if (segments.length === 0)
|
||||
return '';
|
||||
parts.push('M' + f.point(segments[0]._point));
|
||||
for (i = 0, l = segments.length - 1; i < l; i++)
|
||||
for (var i = 0, l = segments.length - 1; i < l; i++)
|
||||
addCurve(segments[i], segments[i + 1], false);
|
||||
if (this._closed) {
|
||||
addCurve(segments[segments.length - 1], segments[0], true);
|
||||
|
|
Loading…
Reference in a new issue