Dragging problem
Dragging problem
- Subject: Dragging problem
- From: Hisaoki Nishida <email@hidden>
- Date: Wed, 5 Mar 2003 02:58:04 -0500
Hello,
I have gotten my drag to work with just one little problem.
I can drag the image fine, but the place where the dragged image
appears is
not at the starting position of the image; it's off set by 300 pixels
or so, to the upper left.
The dragging source area is nicely positioned (in a 64x64 grid, exactly
where I want).
I wonder where the offset comes from, because I passed in NSZeroSize
for offset.
My mouseDragged method:
- (void)mouseDragged:(NSEvent *)newEvent
{
if([[[NSUserDefaults standardUserDefaults]
objectForKey:@"debugEnabled"] boolValue])
NSLog(@"Processing mouseDragged.");
NSPoint location;
NSPasteboard * pboard = [NSPasteboard
pasteboardWithName:NSDragPboard];
if(pieceImage && [self copyDataTo:pboard])
{
location = [newEvent locationInWindow];
[self dragImage:pieceImage at:location offset:NSZeroSize
event:newEvent pasteboard:pboard source:self slideBack:YES];
}
}
Thanks,
-yuki
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.