While a similar effect could be achieved using NSAffineTransforms, it seems like the following API is noticeably absent from the NSGeometry.h AppKit drawing primitives and one I would venture many have included in their own Cocoa toolkits:
typedef enum { NSBottomLeftPoint, NSMiddleLeftPoint, NSTopLeftPoint, NSTopCenterPoint, NSTopRightPoint, NSMiddleRightPoint, NSBottomRightPoint, NSBottomCenterPoint, NSMiddleCenterPoint } NSReferencePoint; extern NSRect NSScaleRect(NSRect aRect, CGFloat dW, CGFloat dH, NSReferencePoint reference); Description: NSScaleRect scales the specified rectangle by the specified width and height scalars about the specified reference point. See http://www.tc.umn.edu/~erick205/NSScaleRect.pdf for a graphical illustration. Implementation: Trivial and effectively amounts to: NSRect scaledRect; CGFloat dx, dy; switch (reference) { ... } scaledRect.origin = aRect.origin; scaledRect.size = NSMakeSize(NSWidth(aRect) * dW, NSHeight(aRect) * dH); return (NSOffsetRect(scaledRect, dx, dy)); Comments on this API, particularly as it concerns inclusion in some future version of AppKit? Is this worth filing a Radar enhancement request for? Regards, Grant _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com