Fixing setCenterX/Y issue. chester-sparrow
authorchsieh <chester.developer@hotmail.com>
Tue, 31 May 2011 06:17:59 +0000 (23:17 -0700)
committerchsieh <chester.developer@hotmail.com>
Tue, 31 May 2011 06:17:59 +0000 (23:17 -0700)
src/render/QQSparrowExtensions.mm

index b8106e6..aaa9f4c 100644 (file)
     return self;
 }
 
-- (float) centerX { return self.x + self.width*0.5f; }
-- (void) setCenterX:(float)x { self.x = x - self.width*0.5f; }
+- (float) centerX { return self.x + self.registrationX; }
+- (void) setCenterX:(float)x { self.x = x - self.registrationX; }
 
-- (float) centerY { return self.y + self.height*0.5f; }
-- (void) setCenterY:(float)y { self.y = y - self.height*0.5f; }
+- (float) centerY { return self.y + self.registrationY; }
+- (void) setCenterY:(float)y { self.y = y - self.registrationY; }
 
 /** Sets coordinates of the object relative to the local coordinates of the parent. */
 - (id) setCenterX:(float)x y:(float)y {