From 6ef5183731a69d8b153a8f19c36b530294c63604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 13 Feb 2011 19:22:48 +0000 Subject: [PATCH] Fix Rectangle#center (use + instead of -). --- src/basic/Rectangle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index 300f7c76..4e07e0cb 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -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() {