mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
No need to create a new segments array in setSegments, just set length of existing one instead.
This commit is contained in:
parent
7a4e49c5d5
commit
848befe103
1 changed files with 3 additions and 3 deletions
|
@ -42,9 +42,9 @@ var Path = this.Path = PathItem.extend({
|
|||
},
|
||||
|
||||
setSegments: function(segments) {
|
||||
var l = segments.length;
|
||||
this._segments = new Array(l);
|
||||
for(var i = 0; i < l; i++) {
|
||||
var length = segments.length;
|
||||
this._segments.length = length;
|
||||
for(var i = 0; i < length; i++) {
|
||||
this._segments[i] = Segment.read(segments, i, 1);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue