Prebuilt module for commit 49fca5510e

This commit is contained in:
Paper.js Bot 2017-03-19 21:56:26 +00:00
parent 0d55cc3280
commit d4d95f98ed
5 changed files with 209 additions and 125 deletions

View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Sun Mar 19 16:17:43 2017 +0100 * Date: Sun Mar 19 22:51:34 2017 +0100
* *
*** ***
* *
@ -1802,16 +1802,24 @@ var Rectangle = Base.extend({
return new ctor(this.width, this.height, this, 'setSize'); return new ctor(this.width, this.height, this, 'setSize');
}, },
_fw: 1,
_fh: 1,
setSize: function() { setSize: function() {
var size = Size.read(arguments); var size = Size.read(arguments),
if (this._fixX) sx = this._sx,
this.x += (this.width - size.width) * this._fixX; sy = this._sy,
if (this._fixY) w = size.width,
this.y += (this.height - size.height) * this._fixY; h = size.height;
this.width = size.width; if (sx) {
this.height = size.height; this.x += (this.width - w) * sx;
this._fixW = 1; }
this._fixH = 1; if (sy) {
this.y += (this.height - h) * sy;
}
this.width = w;
this.height = h;
this._fw = this._fh = 1;
}, },
getLeft: function() { getLeft: function() {
@ -1819,10 +1827,12 @@ var Rectangle = Base.extend({
}, },
setLeft: function(left) { setLeft: function(left) {
if (!this._fixW) if (!this._fw) {
this.width -= left - this.x; var amount = left - this.x;
this.width -= this._sx === 0.5 ? amount * 2 : amount;
}
this.x = left; this.x = left;
this._fixX = 0; this._sx = this._fw = 0;
}, },
getTop: function() { getTop: function() {
@ -1830,10 +1840,12 @@ var Rectangle = Base.extend({
}, },
setTop: function(top) { setTop: function(top) {
if (!this._fixH) if (!this._fh) {
this.height -= top - this.y; var amount = top - this.y;
this.height -= this._sy === 0.5 ? amount * 2 : amount;
}
this.y = top; this.y = top;
this._fixY = 0; this._sy = this._fh = 0;
}, },
getRight: function() { getRight: function() {
@ -1841,13 +1853,13 @@ var Rectangle = Base.extend({
}, },
setRight: function(right) { setRight: function(right) {
if (this._fixX !== undefined && this._fixX !== 1) if (!this._fw) {
this._fixW = 0; var amount = right - this.x;
if (this._fixW) this.width = this._sx === 0.5 ? amount * 2 : amount;
}
this.x = right - this.width; this.x = right - this.width;
else this._sx = 1;
this.width = right - this.x; this._fw = 0;
this._fixX = 1;
}, },
getBottom: function() { getBottom: function() {
@ -1855,31 +1867,47 @@ var Rectangle = Base.extend({
}, },
setBottom: function(bottom) { setBottom: function(bottom) {
if (this._fixY !== undefined && this._fixY !== 1) if (!this._fh) {
this._fixH = 0; var amount = bottom - this.y;
if (this._fixH) this.height = this._sy === 0.5 ? amount * 2 : amount;
}
this.y = bottom - this.height; this.y = bottom - this.height;
else this._sy = 1;
this.height = bottom - this.y; this._fh = 0;
this._fixY = 1;
}, },
getCenterX: function() { getCenterX: function() {
return this.x + this.width * 0.5; return this.x + this.width / 2;
}, },
setCenterX: function(x) { setCenterX: function(x) {
this.x = x - this.width * 0.5; if (this._fw || this._sx === 0.5) {
this._fixX = 0.5; this.x = x - this.width / 2;
} else {
if (this._sx) {
this.x += (x - this.x) * 2 * this._sx;
}
this.width = (x - this.x) * 2;
}
this._sx = 0.5;
this._fw = 0;
}, },
getCenterY: function() { getCenterY: function() {
return this.y + this.height * 0.5; return this.y + this.height / 2;
}, },
setCenterY: function(y) { setCenterY: function(y) {
this.y = y - this.height * 0.5; if (this._fh || this._sy === 0.5) {
this._fixY = 0.5; this.y = y - this.height / 2;
} else {
if (this._sy) {
this.y += (y - this.y) * 2 * this._sy;
}
this.height = (y - this.y) * 2;
}
this._sy = 0.5;
this._fh = 0;
}, },
getCenter: function(_dontLink) { getCenter: function(_dontLink) {

96
dist/paper-core.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Sun Mar 19 16:17:43 2017 +0100 * Date: Sun Mar 19 22:51:34 2017 +0100
* *
*** ***
* *
@ -1802,16 +1802,24 @@ var Rectangle = Base.extend({
return new ctor(this.width, this.height, this, 'setSize'); return new ctor(this.width, this.height, this, 'setSize');
}, },
_fw: 1,
_fh: 1,
setSize: function() { setSize: function() {
var size = Size.read(arguments); var size = Size.read(arguments),
if (this._fixX) sx = this._sx,
this.x += (this.width - size.width) * this._fixX; sy = this._sy,
if (this._fixY) w = size.width,
this.y += (this.height - size.height) * this._fixY; h = size.height;
this.width = size.width; if (sx) {
this.height = size.height; this.x += (this.width - w) * sx;
this._fixW = 1; }
this._fixH = 1; if (sy) {
this.y += (this.height - h) * sy;
}
this.width = w;
this.height = h;
this._fw = this._fh = 1;
}, },
getLeft: function() { getLeft: function() {
@ -1819,10 +1827,12 @@ var Rectangle = Base.extend({
}, },
setLeft: function(left) { setLeft: function(left) {
if (!this._fixW) if (!this._fw) {
this.width -= left - this.x; var amount = left - this.x;
this.width -= this._sx === 0.5 ? amount * 2 : amount;
}
this.x = left; this.x = left;
this._fixX = 0; this._sx = this._fw = 0;
}, },
getTop: function() { getTop: function() {
@ -1830,10 +1840,12 @@ var Rectangle = Base.extend({
}, },
setTop: function(top) { setTop: function(top) {
if (!this._fixH) if (!this._fh) {
this.height -= top - this.y; var amount = top - this.y;
this.height -= this._sy === 0.5 ? amount * 2 : amount;
}
this.y = top; this.y = top;
this._fixY = 0; this._sy = this._fh = 0;
}, },
getRight: function() { getRight: function() {
@ -1841,13 +1853,13 @@ var Rectangle = Base.extend({
}, },
setRight: function(right) { setRight: function(right) {
if (this._fixX !== undefined && this._fixX !== 1) if (!this._fw) {
this._fixW = 0; var amount = right - this.x;
if (this._fixW) this.width = this._sx === 0.5 ? amount * 2 : amount;
}
this.x = right - this.width; this.x = right - this.width;
else this._sx = 1;
this.width = right - this.x; this._fw = 0;
this._fixX = 1;
}, },
getBottom: function() { getBottom: function() {
@ -1855,31 +1867,47 @@ var Rectangle = Base.extend({
}, },
setBottom: function(bottom) { setBottom: function(bottom) {
if (this._fixY !== undefined && this._fixY !== 1) if (!this._fh) {
this._fixH = 0; var amount = bottom - this.y;
if (this._fixH) this.height = this._sy === 0.5 ? amount * 2 : amount;
}
this.y = bottom - this.height; this.y = bottom - this.height;
else this._sy = 1;
this.height = bottom - this.y; this._fh = 0;
this._fixY = 1;
}, },
getCenterX: function() { getCenterX: function() {
return this.x + this.width * 0.5; return this.x + this.width / 2;
}, },
setCenterX: function(x) { setCenterX: function(x) {
this.x = x - this.width * 0.5; if (this._fw || this._sx === 0.5) {
this._fixX = 0.5; this.x = x - this.width / 2;
} else {
if (this._sx) {
this.x += (x - this.x) * 2 * this._sx;
}
this.width = (x - this.x) * 2;
}
this._sx = 0.5;
this._fw = 0;
}, },
getCenterY: function() { getCenterY: function() {
return this.y + this.height * 0.5; return this.y + this.height / 2;
}, },
setCenterY: function(y) { setCenterY: function(y) {
this.y = y - this.height * 0.5; if (this._fh || this._sy === 0.5) {
this._fixY = 0.5; this.y = y - this.height / 2;
} else {
if (this._sy) {
this.y += (y - this.y) * 2 * this._sy;
}
this.height = (y - this.y) * 2;
}
this._sy = 0.5;
this._fh = 0;
}, },
getCenter: function(_dontLink) { getCenter: function(_dontLink) {

File diff suppressed because one or more lines are too long

96
dist/paper-full.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Sun Mar 19 16:17:43 2017 +0100 * Date: Sun Mar 19 22:51:34 2017 +0100
* *
*** ***
* *
@ -1802,16 +1802,24 @@ var Rectangle = Base.extend({
return new ctor(this.width, this.height, this, 'setSize'); return new ctor(this.width, this.height, this, 'setSize');
}, },
_fw: 1,
_fh: 1,
setSize: function() { setSize: function() {
var size = Size.read(arguments); var size = Size.read(arguments),
if (this._fixX) sx = this._sx,
this.x += (this.width - size.width) * this._fixX; sy = this._sy,
if (this._fixY) w = size.width,
this.y += (this.height - size.height) * this._fixY; h = size.height;
this.width = size.width; if (sx) {
this.height = size.height; this.x += (this.width - w) * sx;
this._fixW = 1; }
this._fixH = 1; if (sy) {
this.y += (this.height - h) * sy;
}
this.width = w;
this.height = h;
this._fw = this._fh = 1;
}, },
getLeft: function() { getLeft: function() {
@ -1819,10 +1827,12 @@ var Rectangle = Base.extend({
}, },
setLeft: function(left) { setLeft: function(left) {
if (!this._fixW) if (!this._fw) {
this.width -= left - this.x; var amount = left - this.x;
this.width -= this._sx === 0.5 ? amount * 2 : amount;
}
this.x = left; this.x = left;
this._fixX = 0; this._sx = this._fw = 0;
}, },
getTop: function() { getTop: function() {
@ -1830,10 +1840,12 @@ var Rectangle = Base.extend({
}, },
setTop: function(top) { setTop: function(top) {
if (!this._fixH) if (!this._fh) {
this.height -= top - this.y; var amount = top - this.y;
this.height -= this._sy === 0.5 ? amount * 2 : amount;
}
this.y = top; this.y = top;
this._fixY = 0; this._sy = this._fh = 0;
}, },
getRight: function() { getRight: function() {
@ -1841,13 +1853,13 @@ var Rectangle = Base.extend({
}, },
setRight: function(right) { setRight: function(right) {
if (this._fixX !== undefined && this._fixX !== 1) if (!this._fw) {
this._fixW = 0; var amount = right - this.x;
if (this._fixW) this.width = this._sx === 0.5 ? amount * 2 : amount;
}
this.x = right - this.width; this.x = right - this.width;
else this._sx = 1;
this.width = right - this.x; this._fw = 0;
this._fixX = 1;
}, },
getBottom: function() { getBottom: function() {
@ -1855,31 +1867,47 @@ var Rectangle = Base.extend({
}, },
setBottom: function(bottom) { setBottom: function(bottom) {
if (this._fixY !== undefined && this._fixY !== 1) if (!this._fh) {
this._fixH = 0; var amount = bottom - this.y;
if (this._fixH) this.height = this._sy === 0.5 ? amount * 2 : amount;
}
this.y = bottom - this.height; this.y = bottom - this.height;
else this._sy = 1;
this.height = bottom - this.y; this._fh = 0;
this._fixY = 1;
}, },
getCenterX: function() { getCenterX: function() {
return this.x + this.width * 0.5; return this.x + this.width / 2;
}, },
setCenterX: function(x) { setCenterX: function(x) {
this.x = x - this.width * 0.5; if (this._fw || this._sx === 0.5) {
this._fixX = 0.5; this.x = x - this.width / 2;
} else {
if (this._sx) {
this.x += (x - this.x) * 2 * this._sx;
}
this.width = (x - this.x) * 2;
}
this._sx = 0.5;
this._fw = 0;
}, },
getCenterY: function() { getCenterY: function() {
return this.y + this.height * 0.5; return this.y + this.height / 2;
}, },
setCenterY: function(y) { setCenterY: function(y) {
this.y = y - this.height * 0.5; if (this._fh || this._sy === 0.5) {
this._fixY = 0.5; this.y = y - this.height / 2;
} else {
if (this._sy) {
this.y += (y - this.y) * 2 * this._sy;
}
this.height = (y - this.y) * 2;
}
this._sy = 0.5;
this._fh = 0;
}, },
getCenter: function(_dontLink) { getCenter: function(_dontLink) {

File diff suppressed because one or more lines are too long