Simply call slice() instead of slice(0).

This commit is contained in:
Jürg Lehni 2013-04-06 18:39:17 +02:00
parent 4bc3882c82
commit a0b903e49c
3 changed files with 4 additions and 4 deletions

View file

@ -425,7 +425,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
_transformBounds: function(bounds, dest, dontNotify) { _transformBounds: function(bounds, dest, dontNotify) {
var coords = this._transformCorners(bounds), var coords = this._transformCorners(bounds),
min = coords.slice(0, 2), min = coords.slice(0, 2),
max = coords.slice(0); max = coords.slice();
for (var i = 2; i < 8; i++) { for (var i = 2; i < 8; i++) {
var val = coords[i], var val = coords[i],
j = i & 1; j = i & 1;

View file

@ -579,7 +579,7 @@ statics: {
getBounds: function(v) { getBounds: function(v) {
var min = v.slice(0, 2), // Start with values of point1 var min = v.slice(0, 2), // Start with values of point1
max = min.slice(0), // clone max = min.slice(), // clone
roots = new Array(2); roots = new Array(2);
for (var i = 0; i < 2; i++) for (var i = 0; i < 2; i++)
Curve._addBounds(v[i], v[i + 2], v[i + 4], v[i + 6], Curve._addBounds(v[i], v[i + 2], v[i + 4], v[i + 6],

View file

@ -1239,7 +1239,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
// Prepend all segments from path except the last one // Prepend all segments from path except the last one
this._add(segments.slice(0, segments.length - 1), 0); this._add(segments.slice(0, segments.length - 1), 0);
} else { } else {
this._add(segments.slice(0)); this._add(segments.slice());
} }
} }
path.remove(); path.remove();
@ -2241,7 +2241,7 @@ statics: {
// Make coordinates for first segment available in prevCoords. // Make coordinates for first segment available in prevCoords.
prevCoords = first._transformCoordinates(matrix, new Array(6), false), prevCoords = first._transformCoordinates(matrix, new Array(6), false),
min = prevCoords.slice(0, 2), // Start with values of first point min = prevCoords.slice(0, 2), // Start with values of first point
max = min.slice(0), // clone max = min.slice(), // clone
roots = new Array(2); roots = new Array(2);
function processSegment(segment) { function processSegment(segment) {