Offset mouseLoc?

David Vaughan dvk at
Mon Dec 16 19:03:01 EST 2002

I have written code to drag a line from one field to another or outside 
field boundaries to delete it. When I first did this I used lines like:

on mouseRelease
    put the mouseLoc into dragLoc
    if within(field "whatever",dragloc) then doSomething
(actually, I have a switch statement but for shorter explanation I'll 
say if)

I found in debugging that the mouseLoc function consistently shows a 
location 23 pixels above the actual object location, or above that 
delivered by the parameters to mouseMove. It also seems to be one pixel 
left. That is, if mousemove says the loc is 170,123 then the mouseLoc 
simultaneously returns 169,100. I have tested this in two quite 
different stacks (OS X 10.2.2, Rev 1.1.1).

This is not a current problem in that I abandoned mouseLoc and used the 
loc of the object being dragged, but why is this happening? Does it 
happen for anyone else? Is it consistent on all platforms? I'll test in 
2.0 when the beta appears.


More information about the Use-livecode mailing list