mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 23:39:59 -05:00
Further optimize Segment#initialize for minifying.
This commit is contained in:
parent
d8fbca0d68
commit
362eca7061
1 changed files with 7 additions and 6 deletions
|
@ -50,11 +50,12 @@ var Segment = this.Segment = Base.extend({
|
||||||
* that are visible when the path is selected).
|
* that are visible when the path is selected).
|
||||||
*/
|
*/
|
||||||
initialize: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
initialize: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
||||||
var createPoint = SegmentPoint.create,
|
var count = arguments.length,
|
||||||
|
createPoint = SegmentPoint.create,
|
||||||
point, handleIn, handleOut;
|
point, handleIn, handleOut;
|
||||||
if (arguments.length == 0) {
|
if (count == 0) {
|
||||||
// Nothing
|
// Nothing
|
||||||
} else if (arguments.length == 1) {
|
} else if (count == 1) {
|
||||||
// TODO: If beans are not activated, this won't copy from existing
|
// TODO: If beans are not activated, this won't copy from existing
|
||||||
// segments. OK?
|
// segments. OK?
|
||||||
if (arg0.point) {
|
if (arg0.point) {
|
||||||
|
@ -64,8 +65,8 @@ var Segment = this.Segment = Base.extend({
|
||||||
} else {
|
} else {
|
||||||
point = arg0;
|
point = arg0;
|
||||||
}
|
}
|
||||||
} else if (arguments.length < 6) {
|
} else if (count < 6) {
|
||||||
if (arguments.length == 2 && !arg1.x) {
|
if (count == 2 && !arg1.x) {
|
||||||
point = [ arg0, arg1 ];
|
point = [ arg0, arg1 ];
|
||||||
} else {
|
} else {
|
||||||
point = arg0;
|
point = arg0;
|
||||||
|
@ -74,7 +75,7 @@ var Segment = this.Segment = Base.extend({
|
||||||
handleIn = arg1;
|
handleIn = arg1;
|
||||||
handleOut = arg2;
|
handleOut = arg2;
|
||||||
}
|
}
|
||||||
} else if (arguments.length == 6) {
|
} else if (count == 6) {
|
||||||
point = [ arg0, arg1 ];
|
point = [ arg0, arg1 ];
|
||||||
handleIn = [ arg2, arg3 ];
|
handleIn = [ arg2, arg3 ];
|
||||||
handleOut = [ arg4, arg5 ];
|
handleOut = [ arg4, arg5 ];
|
||||||
|
|
Loading…
Reference in a new issue