mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -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() {
|
||||
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() {
|
||||
var center = Point.read(arguments);
|
||||
this.x = center.x - this.width / 2;
|
||||
this.y = center.y - this.height / 2;
|
||||
this.x = center.x - this.width * 0.5;
|
||||
this.y = center.y - this.height * 0.5;
|
||||
},
|
||||
|
||||
getTopLeft: function() {
|
||||
|
|
Loading…
Reference in a new issue