From 1c1c70beb8fcba6bbcb3f6ca58215e646dca7888 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 16 Mar 2009 14:30:25 +0000 Subject: [Author: avi] Add ability to create rounded rects with different radii for different corners. R=dmaclach --- AppKit/GTMNSBezierPath+RoundRect.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'AppKit/GTMNSBezierPath+RoundRect.h') diff --git a/AppKit/GTMNSBezierPath+RoundRect.h b/AppKit/GTMNSBezierPath+RoundRect.h index b0b48de..25f4605 100644 --- a/AppKit/GTMNSBezierPath+RoundRect.h +++ b/AppKit/GTMNSBezierPath+RoundRect.h @@ -37,6 +37,20 @@ + (NSBezierPath *)gtm_bezierPathWithRoundRect:(NSRect)rect cornerRadius:(CGFloat)radius; +/// Inscribe a round rectangle inside of rectangle |rect| with corner radii specified +// +// Args: +// rect: outer rectangle to inscribe into +// radius*: radii of the corners +// +// Returns: +// Auto released NSBezierPath ++ (NSBezierPath *)gtm_bezierPathWithRoundRect:(NSRect)rect + topLeftCornerRadius:(CGFloat)radiusTL + topRightCornerRadius:(CGFloat)radiusTR + bottomLeftCornerRadius:(CGFloat)radiusBL + bottomRightCornerRadius:(CGFloat)radiusBR; + /// Adds a path which is a round rectangle inscribed inside of rectangle |rect| with a corner radius of |radius| // // Args: @@ -45,4 +59,15 @@ // to be no larger than the smaller of half |rect|'s width or height - (void)gtm_appendBezierPathWithRoundRect:(NSRect)rect cornerRadius:(CGFloat)radius; + +/// Adds a path which is a round rectangle inscribed inside of rectangle |rect| with a corner radii specified +// +// Args: +// rect: outer rectangle to inscribe into +// radius*: radii of the corners +- (void)gtm_appendBezierPathWithRoundRect:(NSRect)rect + topLeftCornerRadius:(CGFloat)radiusTL + topRightCornerRadius:(CGFloat)radiusTR + bottomLeftCornerRadius:(CGFloat)radiusBL + bottomRightCornerRadius:(CGFloat)radiusBR; @end -- cgit v1.2.3