[Editor] Fix AnimationStateMachineEditor pans - #123155
Conversation
|
I tried this patch out on Linux (Wayland), and it appears that the division by the screen scale actually causes panning to slow down on HiDPI displays rather than becoming screen-scale independent. I updated my PR #111305 (haven't pushed yet) to apply the same fix in this PR to the other uses of pan_gesture.delta(), e.g., in scene/gui/tree.cpp, and scrolling the scene tree and AnimationStateMachineEditor noticeably slows down when testing with a 3x screen scaling factor (I tested with 1x, 2x, and 3x scaling factors, on the same device). Removing the EDSCALE factor seems to fix the issue. Does MacOS currently have any issues with the scroll speed (especially on 1x scale) in the scene tree? Just wondering if the scale of this problem on MacOS extends past the AnimationStateMachineEditor. If I assume it does, then screens with 1x scale should be slower to scroll the scene tree, and higher screen scales would make it faster (because scene/gui/tree.cpp doesn't account for the screen scale, and if it needs to by dividing the screen scale in the way that AnimationStateMachineEditor does, then that would imply the pan deltas get scaled up by the screen scale, thus faster scrolling on larger scales). If all of this is true, then it may make more sense to factor in the screen scale earlier, in platform-specific code instead, e.g., in platform/macos/godot_content_view.mm. |
What problem(s) does this PR solve?
AnimationTreeStateMachineEditoris now panning way to fast on macOS using pan gestures #123154Additional information
It fixes the pan using the mouse and using a pan gesture (with a trackpad).
Mouse fix
It's now fixed for screens with > 100% scale. The mouse cursor now follow the contents that pan.
Enregistrement.d.ecran.le.2026-09-03.a.16.05.44.webm
Enregistrement.d.ecran.le.2026-09-03.a.16.12.58.webm
Pan gesture fix
It now uses the real difference in pixels instead of relying on a weird formula.
Enregistrement.d.ecran.le.2026-09-03.a.16.06.04.webm
Enregistrement.d.ecran.le.2026-09-03.a.16.13.22.webm