Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling glitch when using GraphEdit on mobile #36312

Closed
noidexe opened this issue Feb 17, 2020 · 5 comments · Fixed by #62289
Closed

Scrolling glitch when using GraphEdit on mobile #36312

noidexe opened this issue Feb 17, 2020 · 5 comments · Fixed by #62289

Comments

@noidexe
Copy link
Contributor

noidexe commented Feb 17, 2020

Godot version:
3.2

OS/device including version:
Description: Manjaro Linux
Release: 18.1.5
Codename: Juhraya
Kernel: Linux 5.4.15-2-MANJARO
Architecture: x86-64

Mobile targets:
Moto XT1572
Moto g(7) power

Issue description:
GraphEdit nodes scroll uncontrollably and randomly when dragging scrollbars or simple when selecting multiple GraphNodes with touch and drag.
I though it was triggered by a PanGesture being detected but it's not always the case.
Here's a video. Sorry I forgot to enable tap display. I'm touching the background and sometimes it triggers a multiple selection and sometimes it makes the scrolling jump around like crazy.
Same thing while dragging a GraphNode. Also when dragging a scrollbar.
The signal for user scrolling is emitting when the glitch occurs as you can see on the console

https://photos.app.goo.gl/CVeh18JfgECNzyce9

Steps to reproduce:

  • run the attached project
  • tap and drag on the GraphEdit background
    Expected:
  • a multiple selection is initiated
    Actual:
  • sometimes a multiple selection is initiated, sometimes the graphedit starts scrolling randomly

Minimal reproduction project:
issue36312.tar.gz

@noidexe
Copy link
Contributor Author

noidexe commented Feb 18, 2020

Commenting the following code seems to fix the bug:

godot/scene/gui/graph_edit.cpp

Lines 1073 to 1078 in 6e64036

Ref<InputEventPanGesture> pan_gesture = p_ev;
if (pan_gesture.is_valid()) {
h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * pan_gesture->get_delta().x / 8);
v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * pan_gesture->get_delta().y / 8);
}

PanGesture on android seems to be detected by a 1 finger touch and drag so it's probably conflicting with other input code. I don't know if there is any use for detecting the gesture unless it's done with more than one finger on some platform.

Also, pinch and zoom doesn't seem to trigger MagnifyGesture, at least not on Android so I'm not sure if the following lines are doing anything:

godot/scene/gui/graph_edit.cpp

Lines 1067 to 1071 in 6e64036

Ref<InputEventMagnifyGesture> magnify_gesture = p_ev;
if (magnify_gesture.is_valid()) {
set_zoom_custom(zoom * magnify_gesture->get_factor(), magnify_gesture->get_position());
}

@Calinou
Copy link
Member

Calinou commented Feb 18, 2020

@noidexe Gestures are currently only implemented on macOS, see #13139.

@akien-mga
Copy link
Member

Actually PanGesture was implemented in #33630.
There was then a fixup to that PR which will be in 3.2.1: #35701, but it's for the double-tap part, so likely not involved here.

@KoBeWi
Copy link
Member

KoBeWi commented Dec 21, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

@noidexe
Copy link
Contributor Author

noidexe commented Dec 21, 2020

Confirmed on 3.2.3. Exactly the same behavior.

@KoBeWi KoBeWi removed this from the 4.0 milestone Apr 9, 2022
@akien-mga akien-mga added this to the 3.5 milestone Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants