Michael Gardner wrote:
> I've got some code in an NSImageView subclass that looks like this:
> 
> -(void) mouseDown: (NSEvent*)event
> {
>        ...
>        [self dragImage: [self image] at: NSZeroPoint offset:
> NSZeroSize event: event pasteboard: pboard source: self slideBack:
> YES];
>        ...
> }
> 
> and in the dragging destination, I position the dropped object at
> [sender draggedImageLocation]. This worked in the latest release
> version of GNUstep, but in trunk the value that I get from
> -draggedImageLocation is offset by 1 pixel horizontally and 9 pixels
> vertically from where it should be. I believe those dimensions are
> exactly the width and height of the decorations on the left and bottom
> edges of the enclosing window, respectively.
> 

I am not sure here, but to me it looks like the problem stems from the
fact that your code relies on NSZeroPoint being the origin of the
window. But when calling this method on the view the handed in point
will first be translated to window coordinates which may take the window
border into account, depending on whether GNUstep is handling it or not.
You could easily work around this by calling the same method on _window
instead of self.

Cheers,
Fred


_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to