• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBezierPath containsPoint?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: NSBezierPath containsPoint? (From: Robert Clair <email@hidden>)

  • Prev by Date: Re: NSBezierPath containsPoint?
  • Next by Date: Re: DO, replyWithException and oneway void message...
  • Previous by thread: Re: NSBezierPath containsPoint?
  • Next by thread: Re: NSBezierPath containsPoint?
  • Index(es):
    • Date
    • Thread