Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird behavior of mouse location when performing a drag



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Weird behavior of mouse location when performing a drag (From: Gustavo Pizano <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.