replace 'Rect' .. with 'Line' .. do you see the issue then?
if no:
Rect mx, my, EventX()-mx, EventY()-my
Rect works with x,y,width,height .. while your routine is done for: x1,y1,x2,y2 .. slightly different ..
if no:
Rect mx, my, EventX()-mx, EventY()-my
Rect works with x,y,width,height .. while your routine is done for: x1,y1,x2,y2 .. slightly different ..