asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

Set offset to zero if null for movRel(None,None) #691

Closed JayRizzo closed 2 years ago

JayRizzo commented 2 years ago

When calling _normalizeXYArgs(xOffset, yOffset) if None is passed for both values the offset is returned with position(x,y) of where the mouse currently is.

# line 655
    if firstArg is None and secondArg is None:
        return position()

This was updated for dragRel() & mouseMoveDrag() & displayMousePosition() but not for movRel().

Therefore artificially moving the mouse dramatically off the screen depending on location of starting position.

This fixes the issue.