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

scale mouse position in touch history
This commit is contained in:
Dean Lee
2025-11-04 00:55:05 +08:00
committed by GitHub
parent 5ea5f6f267
commit 9bf904e8a6
+1 -1
View File
@@ -410,7 +410,7 @@ class GuiApplication:
for mouse_event in self._mouse_events:
if mouse_event.left_pressed:
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
while self._mouse_history and (current_time - self._mouse_history[0].t) > TOUCH_HISTORY_TIMEOUT: