diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-03-16 14:30:25 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-03-16 14:30:25 +0000 |
commit | 1c1c70beb8fcba6bbcb3f6ca58215e646dca7888 (patch) | |
tree | e1c780c73efa2e6b439adb039da774d4730eb91b /AppKit/GTMNSBezierPath+RoundRectTest.m | |
parent | f14883b92b7df63f9b7c368d138a551c75c8c977 (diff) |
[Author: avi]
Add ability to create rounded rects with different radii for different corners.
R=dmaclach
Diffstat (limited to 'AppKit/GTMNSBezierPath+RoundRectTest.m')
-rw-r--r-- | AppKit/GTMNSBezierPath+RoundRectTest.m | 14 |
1 files changed, 12 insertions, 2 deletions
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]; } |