mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-01 08:23:35 +00:00
In addition to setting the center of a view's frame, now you can query it.
This commit is contained in:
@@ -573,6 +573,15 @@ var DOMElementPrototype = nil,
|
||||
[self setFrameOrigin:CGPointMake(aPoint.x - _frame.size.width / 2.0, aPoint.y - _frame.size.height / 2.0)];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the center of the receiver's frame to the provided point. The point is defined in the superview's coordinate system.
|
||||
@return CGPoint the center point of the receiver's frame
|
||||
*/
|
||||
- (void)center
|
||||
{
|
||||
return CGPointMake(_frame.size.width / 2.0 + _frame.origin.x, _frame.size.height / 2.0 + _frame.origin.y);
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the receiver's frame origin to the provided point. The point is defined in the superview's coordinate system.
|
||||
The method posts a CPViewFrameDidChangeNotification to the default notification center if the receiver
|
||||
|
||||
Reference in New Issue
Block a user