diff --git a/ChangeLog b/ChangeLog index 6df313d20..6394bcd44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-12-22 Fred Kiefer + + * Headers/AppKit/NSView.h, + * Source/NSView.m: Add the 10.5 coordinate transformation methods. + 2010-12-22 Fred Kiefer * Headers/AppKit/NSDragging.h, diff --git a/Headers/AppKit/NSView.h b/Headers/AppKit/NSView.h index 32236cd57..4b309cd8a 100644 --- a/Headers/AppKit/NSView.h +++ b/Headers/AppKit/NSView.h @@ -239,6 +239,14 @@ PACKAGE_SCOPE fromView: (NSView*)aView; - (NSSize) convertSize: (NSSize)aSize toView: (NSView*)aView; +#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) +- (NSPoint) convertPointFromBase: (NSPoint)aPoint; +- (NSPoint) convertPointToBase: (NSPoint)aPoint; +- (NSRect) convertRectFromBase: (NSRect)aRect; +- (NSRect) convertRectToBase: (NSRect)aRect; +- (NSSize) convertSizeFromBase: (NSSize)aSize; +- (NSSize) convertSizeToBase: (NSSize)aSize; +#endif /* * Notifying Ancestor Views diff --git a/Source/NSView.m b/Source/NSView.m index 9bf47e9ab..c7d927df2 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -1844,6 +1844,36 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, return new; } +- (NSPoint) convertPointFromBase: (NSPoint)aPoint +{ + return [self convertPoint: aPoint fromView: nil]; +} + +- (NSPoint) convertPointToBase: (NSPoint)aPoint +{ + return [self convertPoint: aPoint toView: nil]; +} + +- (NSRect) convertRectFromBase: (NSRect)aRect +{ + return [self convertRect: aRect fromView: nil]; +} + +- (NSRect) convertRectToBase: (NSRect)aRect +{ + return [self convertRect: aRect toView: nil]; +} + +- (NSSize) convertSizeFromBase: (NSSize)aSize +{ + return [self convertSize: aSize fromView: nil]; +} + +- (NSSize) convertSizeToBase: (NSSize)aSize +{ + return [self convertSize: aSize toView: nil]; +} + /** * Sets whether the receiver should post NSViewFrameDidChangeNotification * when its frame changed.