mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Switch to using Base.isArray.
This commit is contained in:
parent
8a61599c7d
commit
7355c2d4a7
5 changed files with 5 additions and 5 deletions
|
@ -42,7 +42,7 @@ var Matrix = this.Matrix = Base.extend({
|
||||||
var mx = arguments[0];
|
var mx = arguments[0];
|
||||||
if (mx instanceof Matrix) {
|
if (mx instanceof Matrix) {
|
||||||
this.set(mx._m00, mx._m10, mx._m01, mx._m11, mx._m02, mx._m12);
|
this.set(mx._m00, mx._m10, mx._m01, mx._m11, mx._m02, mx._m12);
|
||||||
} else if (Array.isArray(mx)) {
|
} else if (Base.isArray(mx)) {
|
||||||
this.set.apply(this, mx);
|
this.set.apply(this, mx);
|
||||||
} else {
|
} else {
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
|
@ -20,7 +20,7 @@ var Point = this.Point = Base.extend({
|
||||||
} else if (arg.width !== undefined) {
|
} else if (arg.width !== undefined) {
|
||||||
this.x = arg.width;
|
this.x = arg.width;
|
||||||
this.y = arg.height;
|
this.y = arg.height;
|
||||||
} else if (Array.isArray(arg)) {
|
} else if (Base.isArray(arg)) {
|
||||||
this.x = arg[0];
|
this.x = arg[0];
|
||||||
this.y = arg.length > 1 ? arg[1] : arg[0];
|
this.y = arg.length > 1 ? arg[1] : arg[0];
|
||||||
} else if (typeof arg === 'number') {
|
} else if (typeof arg === 'number') {
|
||||||
|
|
|
@ -13,7 +13,7 @@ var Size = this.Size = Base.extend({
|
||||||
} else if (arg.x !== undefined) {
|
} else if (arg.x !== undefined) {
|
||||||
this.width = arg.x;
|
this.width = arg.x;
|
||||||
this.height = arg.y;
|
this.height = arg.y;
|
||||||
} else if (Array.isArray(arg)) {
|
} else if (Base.isArray(arg)) {
|
||||||
this.width = arg[0];
|
this.width = arg[0];
|
||||||
this.height = arg.length > 1 ? arg[1] : arg[0];
|
this.height = arg.length > 1 ? arg[1] : arg[0];
|
||||||
} else if (typeof arg === 'number') {
|
} else if (typeof arg === 'number') {
|
||||||
|
|
|
@ -85,7 +85,7 @@ var RGBColor = this.RGBColor = Color.extend(new function() {
|
||||||
this._green = components[1];
|
this._green = components[1];
|
||||||
this._blue = components[2];
|
this._blue = components[2];
|
||||||
this.alpha = -1;
|
this.alpha = -1;
|
||||||
} else if (Array.isArray(arg)) {
|
} else if (Base.isArray(arg)) {
|
||||||
this._red = arg[0];
|
this._red = arg[0];
|
||||||
this._green = arg[1];
|
this._green = arg[1];
|
||||||
this._blue = arg[2];
|
this._blue = arg[2];
|
||||||
|
|
|
@ -9,7 +9,7 @@ var Path = this.Path = PathItem.extend({
|
||||||
// If it is an array, it can also be a description of a point, so
|
// If it is an array, it can also be a description of a point, so
|
||||||
// check its first entry for object as well
|
// check its first entry for object as well
|
||||||
var segments = arguments[0];
|
var segments = arguments[0];
|
||||||
if (!segments || !Array.isArray(segments)
|
if (!segments || !Base.isArray(segments)
|
||||||
|| typeof segments[0] != 'object')
|
|| typeof segments[0] != 'object')
|
||||||
segments = arguments;
|
segments = arguments;
|
||||||
for (var i = 0, l = segments.length; i < l; i++) {
|
for (var i = 0, l = segments.length; i < l; i++) {
|
||||||
|
|
Loading…
Reference in a new issue