Weird behavior of mouse location when performing a drag
Weird behavior of mouse location when performing a drag
- Subject: Weird behavior of mouse location when performing a drag
- From: Gustavo Pizano <email@hidden>
- Date: Mon, 8 Dec 2008 18:56:17 +0100
Hello all.
Well Im performing a drag-ndrop between views of the same app, I
implemented the - (NSDragOperation)draggingUpdated:(id <
NSDraggingInfo >)sender method, because I need to know the location of
the mouse so I can place the image in the correct position of the
view. But weirdly after converting the point to the currentview there
was a gap of about 145ox in x coordinate and 45 px in the y coord,
those values are not even close to where the view resides in the
window. So what I did to fix the problem was the following.
- (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender
{
NSPoint converted = [NSEvent mouseLocation];
actualDragPoint = [self convertPoint:converted fromView:nil];
actualDragPoint.x = actualDragPoint.x - 144 ;
actualDragPoint.y = actualDragPoint.y -76;
return NSDragOperationMove;
}
it fixed the problem, but Im wondering why is this happening?
Any clues?
Thanks
Gustavo
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden