Skip to content

Commit 95b294d

Browse files
committed
Path: Removed unneeded Array.prototype.calls.
1 parent dfe314b commit 95b294d

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/extras/core/Path.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,12 @@ THREE.Path.prototype.fromPoints = function ( vectors ) {
4242

4343
THREE.Path.prototype.moveTo = function ( x, y ) {
4444

45-
var args = Array.prototype.slice.call( arguments );
46-
this.actions.push( { action: 'moveTo', args: args } );
45+
this.actions.push( { action: 'moveTo', args: [ x, y ] } );
4746

4847
};
4948

5049
THREE.Path.prototype.lineTo = function ( x, y ) {
5150

52-
var args = Array.prototype.slice.call( arguments );
53-
5451
var lastargs = this.actions[ this.actions.length - 1 ].args;
5552

5653
var x0 = lastargs[ lastargs.length - 2 ];
@@ -59,14 +56,12 @@ THREE.Path.prototype.lineTo = function ( x, y ) {
5956
var curve = new THREE.LineCurve( new THREE.Vector2( x0, y0 ), new THREE.Vector2( x, y ) );
6057
this.curves.push( curve );
6158

62-
this.actions.push( { action: 'lineTo', args: args } );
59+
this.actions.push( { action: 'lineTo', args: [ x, y ] } );
6360

6461
};
6562

6663
THREE.Path.prototype.quadraticCurveTo = function( aCPx, aCPy, aX, aY ) {
6764

68-
var args = Array.prototype.slice.call( arguments );
69-
7065
var lastargs = this.actions[ this.actions.length - 1 ].args;
7166

7267
var x0 = lastargs[ lastargs.length - 2 ];
@@ -80,14 +75,12 @@ THREE.Path.prototype.quadraticCurveTo = function( aCPx, aCPy, aX, aY ) {
8075

8176
this.curves.push( curve );
8277

83-
this.actions.push( { action: 'quadraticCurveTo', args: args } );
78+
this.actions.push( { action: 'quadraticCurveTo', args: [ aCPx, aCPy, aX, aY ] } );
8479

8580
};
8681

8782
THREE.Path.prototype.bezierCurveTo = function( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {
8883

89-
var args = Array.prototype.slice.call( arguments );
90-
9184
var lastargs = this.actions[ this.actions.length - 1 ].args;
9285

9386
var x0 = lastargs[ lastargs.length - 2 ];
@@ -102,13 +95,14 @@ THREE.Path.prototype.bezierCurveTo = function( aCP1x, aCP1y, aCP2x, aCP2y, aX, a
10295

10396
this.curves.push( curve );
10497

105-
this.actions.push( { action: 'bezierCurveTo', args: args } );
98+
this.actions.push( { action: 'bezierCurveTo', args: [ aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ] } );
10699

107100
};
108101

109102
THREE.Path.prototype.splineThru = function( pts /*Array of Vector*/ ) {
110103

111104
var args = Array.prototype.slice.call( arguments );
105+
112106
var lastargs = this.actions[ this.actions.length - 1 ].args;
113107

114108
var x0 = lastargs[ lastargs.length - 2 ];

0 commit comments

Comments
 (0)