More beans clean-up in Rectangle.

This commit is contained in:
Jürg Lehni 2011-03-05 01:59:15 +00:00
parent e87e7b2582
commit b06bf88aed

View file

@ -125,13 +125,13 @@ var Rectangle = this.Rectangle = Base.extend({
}, },
getCenter: function() { getCenter: function() {
return Point.create(this.x + this.width * 0.5, this.y + this.height * 0.5); return Point.create(this.getCenterX(), this.getCenterY());
}, },
setCenter: function() { setCenter: function() {
var center = Point.read(arguments); var center = Point.read(arguments);
this.x = center.x - this.width * 0.5; this.setCenterX(center.x);
this.y = center.y - this.height * 0.5; this.setCenterY(center.y);
}, },
getTopLeft: function() { getTopLeft: function() {
@ -160,8 +160,8 @@ var Rectangle = this.Rectangle = Base.extend({
setBottomLeft: function() { setBottomLeft: function() {
var bottomLeft = Point.read(arguments); var bottomLeft = Point.read(arguments);
this.left = bottomLeft.x; this.setLeft(bottomLeft.x);
this.bottom = bottomLeft.y; this.setBottom(bottomLeft.y);
}, },
getBottomRight: function() { getBottomRight: function() {