mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 06:10:14 -04:00
Reformating code to follow Scriptotgrapher coding conventions.
This commit is contained in:
parent
50b2e12372
commit
08d4826441
26 changed files with 146 additions and 146 deletions
src/basic
|
@ -1,20 +1,20 @@
|
|||
var Size = Base.extend({
|
||||
initialize: function() {
|
||||
if(arguments.length == 2) {
|
||||
if (arguments.length == 2) {
|
||||
this.width = arguments[0];
|
||||
this.height = arguments[1];
|
||||
} else if(arguments.length == 1) {
|
||||
} else if (arguments.length == 1) {
|
||||
var first = arguments[0];
|
||||
if(first.width !== undefined || first.height !== undefined) {
|
||||
if (first.width !== undefined || first.height !== undefined) {
|
||||
this.width = first.width ? first.width : 0;
|
||||
this.height = first.height ? first.height : 0;
|
||||
} else if(first.x !== undefined || first.y !== undefined) {
|
||||
} else if (first.x !== undefined || first.y !== undefined) {
|
||||
this.width = first.x ? first.x : 0;
|
||||
this.height = first.y ? first.y : 0;
|
||||
} else if(first.length !== undefined) {
|
||||
} else if (first.length !== undefined) {
|
||||
this.width = first[0];
|
||||
this.height = first.length > 1 ? first[1] : first[0];
|
||||
} else if(typeof first === 'number') {
|
||||
} else if (typeof first === 'number') {
|
||||
this.width = this.height = first;
|
||||
} else {
|
||||
this.width = this.height = 0;
|
||||
|
@ -113,4 +113,4 @@ var Size = Base.extend({
|
|||
return new Size(Math.random(), Math.random());
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue