aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMNSBezierPath+RoundRect.m
diff options
context:
space:
mode:
authorGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-05-09 18:53:09 +0000
committerGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-05-09 18:53:09 +0000
commitf90bcf3263b80b96754977ddbd5309704cf817fb (patch)
tree585db4c1126cea3bd0ff9b338628d33febe36e59 /AppKit/GTMNSBezierPath+RoundRect.m
parente5c365c04b9f2f6d04b2c5bd828f39fab2882e7d (diff)
Flush out suppport for 64bit, GC support.
Added some more xcode configs related to the above. Removed some classes that the unittesting doesn't need (and aren't able to support 64bit). add base64, httpfetcher, and progress monitor stream.
Diffstat (limited to 'AppKit/GTMNSBezierPath+RoundRect.m')
-rw-r--r--AppKit/GTMNSBezierPath+RoundRect.m22
1 files changed, 16 insertions, 6 deletions
diff --git a/AppKit/GTMNSBezierPath+RoundRect.m b/AppKit/GTMNSBezierPath+RoundRect.m
index 4b98dc9..d4e5050 100644
--- a/AppKit/GTMNSBezierPath+RoundRect.m
+++ b/AppKit/GTMNSBezierPath+RoundRect.m
@@ -24,14 +24,16 @@
@implementation NSBezierPath (GTMBezierPathRoundRectAdditions)
-+ (NSBezierPath *)gtm_bezierPathWithRoundRect:(NSRect)rect cornerRadius:(float)radius {
++ (NSBezierPath *)gtm_bezierPathWithRoundRect:(NSRect)rect
+ cornerRadius:(CGFloat)radius {
NSBezierPath *bezier = [NSBezierPath bezierPath];
[bezier gtm_appendBezierPathWithRoundRect:rect cornerRadius:radius];
return bezier;
}
-- (void)gtm_appendBezierPathWithRoundRect:(NSRect)rect cornerRadius:(float)radius {
+- (void)gtm_appendBezierPathWithRoundRect:(NSRect)rect
+ cornerRadius:(CGFloat)radius {
if (!NSIsEmptyRect(rect)) {
if (radius > 0.0) {
// Clamp radius to be no larger than half the rect's width or height.
@@ -42,10 +44,18 @@
NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect));
[self moveToPoint:NSMakePoint(NSMidX(rect), NSMaxY(rect))];
- [self appendBezierPathWithArcFromPoint:topLeft toPoint:rect.origin radius:radius];
- [self appendBezierPathWithArcFromPoint:rect.origin toPoint:bottomRight radius:radius];
- [self appendBezierPathWithArcFromPoint:bottomRight toPoint:topRight radius:radius];
- [self appendBezierPathWithArcFromPoint:topRight toPoint:topLeft radius:radius];
+ [self appendBezierPathWithArcFromPoint:topLeft
+ toPoint:rect.origin
+ radius:radius];
+ [self appendBezierPathWithArcFromPoint:rect.origin
+ toPoint:bottomRight
+ radius:radius];
+ [self appendBezierPathWithArcFromPoint:bottomRight
+ toPoint:topRight
+ radius:radius];
+ [self appendBezierPathWithArcFromPoint:topRight
+ toPoint:topLeft
+ radius:radius];
[self closePath];
} else {
// When radius <= 0.0, use plain rectangle.