Skip to content

Commit

Permalink
mouse position fixing...
Browse files Browse the repository at this point in the history
  • Loading branch information
pevogam committed Oct 22, 2020
1 parent 4fa0a92 commit b87396d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion guibot/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ def __synchronize_backend(self, backend=None, category="pyautogui", reset=False)
self._backend_obj = pyautogui

self._width, self._height = self._backend_obj.size()
self._pointer = self._backend_obj.position()
self._pointer = self.mouse_location
self._keymap = inputmap.PyAutoGUIKey()
self._modmap = inputmap.PyAutoGUIKeyModifier()
self._mousemap = inputmap.PyAutoGUIMouseButton()
Expand Down
5 changes: 3 additions & 2 deletions tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ def test_mouse_move(self):
display.mouse_move(Location(30, 20), smooth=is_smooth)
location = display.mouse_location
# some backends are not pixel perfect
self.assertAlmostEqual(location.x, 30, delta=1)
self.assertAlmostEqual(location.y, 20, delta=1)
msg = "%s %s %s %s" % (display, is_smooth, location.x, location.y)
self.assertAlmostEqual(location.x, 30, delta=1, msg=msg)
self.assertAlmostEqual(location.y, 20, delta=1, msg=msg)

@unittest.skipIf(os.environ.get('DISABLE_PYQT', "0") == "1", "PyQt disabled")
def test_mouse_click(self):
Expand Down

0 comments on commit b87396d

Please sign in to comment.