ui: scale mouse positions in touch history (#36530)

scale mouse position in touch history
pull/36574/head
Dean Lee 7 days ago committed by GitHub
parent 5ea5f6f267
commit 9bf904e8a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      system/ui/lib/application.py

@ -410,7 +410,7 @@ class GuiApplication:
for mouse_event in self._mouse_events: for mouse_event in self._mouse_events:
if mouse_event.left_pressed: if mouse_event.left_pressed:
self._mouse_history.clear() self._mouse_history.clear()
self._mouse_history.append(MousePosWithTime(mouse_event.pos.x, mouse_event.pos.y, current_time)) self._mouse_history.append(MousePosWithTime(mouse_event.pos.x * self._scale, mouse_event.pos.y * self._scale, current_time))
# Remove old touch points that exceed the timeout # Remove old touch points that exceed the timeout
while self._mouse_history and (current_time - self._mouse_history[0].t) > TOUCH_HISTORY_TIMEOUT: while self._mouse_history and (current_time - self._mouse_history[0].t) > TOUCH_HISTORY_TIMEOUT:

Loading…
Cancel
Save