[BUG][FIX] Off-by-one error in 3.7a-5707 PLM drag-and-drop ( possible fix )

Ned Konz ned at squeakland.org
Tue Feb 17 20:05:34 UTC 2004


On Tuesday 17 February 2004 10:33 am, brentvukmer at yahoo.com wrote:
> I have noticed that when drag-and-drop is enabled, that I repeatedly see
> an off-by-one error in the Browser. I'll select a method and drag it to
> a different method category, but when the drop finishes, I usually see a
> method *other than the one I selected* in the target method category.

Do you see the desired method name when you are dragging?

> I have been debugging in PluggableListMorph >> startDrag:.  My guess is
> the problem is that the event being passed in has the wrong position.

Probably.

> The event's position seems to be generated by HandMorph >>
> generateDropFilesEvent:  This method was last changed by dgd in March
> 2003.

I don't think that's where the event is generated.

If you look at MouseClickState: you will see that the startDrag: is passed the 
event that is detected as the beginning of the drag: that is, the point that 
is at least 10 pixels from the original firstClickDown position.

Thinking about it, though, it seems that you'd want to see the firstClickDown 
position instead.

The attached CS changes this; please try it out.

-- 
Ned Konz
http://bike-nomad.com/squeak/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StartDragFix-nk.1.cs.gz
Type: application/x-gzip
Size: 1094 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040217/9bb119e6/StartDragFix-nk.1.cs.bin


More information about the Squeak-dev mailing list