Re: What am I doing wrong in my drag loop? Dragging jumps all over the place.
Re: What am I doing wrong in my drag loop? Dragging jumps all over the place.
- Subject: Re: What am I doing wrong in my drag loop? Dragging jumps all over the place.
- From: "Sean McBride" <email@hidden>
- Date: Wed, 20 Jul 2005 13:22:11 -0400
- Organization: Rogue Research
On 2005-07-20 10:02, Dave Camp said:
> theEvent = [[self window] nextEventMatchingMask:
>(NSLeftMouseDraggedMask | NSLeftMouseUpMask)];
> NSPoint curPoint = [self convertPoint:[theEvent
>locationInWindow] fromView:nil];
You aren't checking theEvent for nil. nextEventMatchingMask: is
documented to possibly return nil. locationInWindow returns an NSRect,
but you can't rely on the return value of a message to a nil object (at
least not when its a struct).
Funny you post this today, I just fixed this exact bug in a 3rd party
library the other day. :)
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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