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+RoundRectTest.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'AppKit/GTMNSBezierPath+RoundRectTest.m') diff --git a/AppKit/GTMNSBezierPath+RoundRectTest.m b/AppKit/GTMNSBezierPath+RoundRectTest.m index 5bdf3a3..101460c 100644 --- a/AppKit/GTMNSBezierPath+RoundRectTest.m +++ b/AppKit/GTMNSBezierPath+RoundRectTest.m @@ -28,7 +28,7 @@ @implementation GTMNSBezierPath_RoundRectTest - (void)testRoundRects { - GTMAssertDrawingEqualToImageNamed(self, NSMakeSize(490, 430), + GTMAssertDrawingEqualToImageNamed(self, NSMakeSize(490, 500), @"GTMNSBezierPath+RoundRectTest", nil, nil); } @@ -95,7 +95,17 @@ [roundRect stroke]; theRects[j].origin.y += 35.0; } - } + } + + // Different radii + NSRect bigRect = NSMakeRect(50, 440, 200, 40); + NSBezierPath *roundRect = [NSBezierPath gtm_bezierPathWithRoundRect:bigRect + topLeftCornerRadius:0.0 + topRightCornerRadius:5.0 + bottomLeftCornerRadius:10.0 + bottomRightCornerRadius:20.0]; + [roundRect setLineWidth:5.0]; + [roundRect stroke]; } -- cgit v1.2.3