Re: NSBezierPath containsPoint?
Re: NSBezierPath containsPoint?
- Subject: Re: NSBezierPath containsPoint?
- From: "Brian O'Brien" <email@hidden>
- Date: Thu, 20 Oct 2005 20:57:16 -0600
Take this code for example....
It is from the Sketch example
/Developer/Examples/AppKit/Sketch/Sketch.xcodeproj/
SKTGraphicView.m
- (SKTGraphic *)graphicUnderPoint:(NSPoint)point {
SKTDrawDocument *document = [self drawDocument];
NSArray *graphics = [document graphics];
unsigned i, c = [graphics count];
SKTGraphic *curGraphic = nil;
for (i=0; i<c; i++) {
curGraphic = [graphics objectAtIndex:i];
if ([self mouse:point inRect:[curGraphic drawingBounds]] &&
[curGraphic hitTest:point isSelected:[self
graphicIsSelected:curGraphic]]) {
break;
}
}
if (i < c) {
return curGraphic;
} else {
return nil;
}
}
The line [self mouse:point....
Seems to be how this example selects a line and it works like a charm...
I just can't figure out how it does it...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden