mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Fix Rectangle#center (use + instead of -).
This commit is contained in:
parent
20746ad3a7
commit
6ef5183731
1 changed files with 3 additions and 3 deletions
|
@ -118,13 +118,13 @@ Rectangle = Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
getCenter: function() {
|
getCenter: function() {
|
||||||
return new Point(this.x - this.width / 2, this.y - this.height / 2);
|
return new Point(this.x + this.width * 0.5, this.y + this.height * 0.5);
|
||||||
},
|
},
|
||||||
|
|
||||||
setCenter: function() {
|
setCenter: function() {
|
||||||
var center = Point.read(arguments);
|
var center = Point.read(arguments);
|
||||||
this.x = center.x - this.width / 2;
|
this.x = center.x - this.width * 0.5;
|
||||||
this.y = center.y - this.height / 2;
|
this.y = center.y - this.height * 0.5;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTopLeft: function() {
|
getTopLeft: function() {
|
||||||
|
|
Loading…
Reference in a new issue