Minor minification

This commit is contained in:
sapics 2015-12-03 14:42:27 +09:00 committed by Jürg Lehni
parent 0050984d83
commit 9c1c00c11e
4 changed files with 17 additions and 14 deletions

View file

@ -112,10 +112,10 @@ var Group = Item.extend(/** @lends Group# */{
// looked for yet).
if (clipItem === undefined) {
clipItem = null;
for (var i = 0, l = this._children.length; i < l; i++) {
var child = this._children[i];
if (child._clipMask) {
clipItem = child;
var children = this._children;
for (var i = 0, l = children.length; i < l; i++) {
if (children[i]._clipMask) {
clipItem = children[i];
break;
}
}
@ -187,8 +187,9 @@ var Group = Item.extend(/** @lends Group# */{
clipItem.draw(ctx, param.extend({ clip: true }));
}
if (draw) {
for (var i = 0, l = this._children.length; i < l; i++) {
var item = this._children[i];
var children = this._children;
for (var i = 0, l = children.length; i < l; i++) {
var item = children[i];
if (item !== clipItem)
item.draw(ctx, param);
}

View file

@ -1596,9 +1596,10 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
},
_contains: function(point) {
if (this._children) {
for (var i = this._children.length - 1; i >= 0; i--) {
if (this._children[i].contains(point))
var children = this._children;
if (children) {
for (var i = children.length - 1; i >= 0; i--) {
if (children[i].contains(point))
return true;
}
return false;

View file

@ -136,8 +136,9 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
},
smooth: function() {
for (var i = 0, l = this._children.length; i < l; i++)
this._children[i].smooth();
var children = this._children;
for (var i = 0, l = children.length; i < l; i++)
children[i].smooth();
},
// DOCS: reduce()

View file

@ -367,9 +367,9 @@ var Path = PathItem.extend(/** @lends Path# */{
},
_transformContent: function(matrix) {
var coords = new Array(6);
for (var i = 0, l = this._segments.length; i < l; i++)
this._segments[i]._transformCoordinates(matrix, coords, true);
var coords = new Array(6), segments = this._segments;
for (var i = 0, l = segments.length; i < l; i++)
segments[i]._transformCoordinates(matrix, coords, true);
return true;
},