Re: Weird behavior of mouse location when performing a drag
Re: Weird behavior of mouse location when performing a drag
- Subject: Re: Weird behavior of mouse location when performing a drag
- From: chaitanya pandit <email@hidden>
- Date: Wed, 10 Dec 2008 14:25:29 +0530
Try this,
NSPoint apoint = [self convertPoint:[sender draggedImageLocation]
fromView:nil];
HTH,
Chaitanya
On 08-Dec-08, at 11:26 PM, Gustavo Pizano wrote:
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
_______________________________________________
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