GDQuest / learn-gdscript

Learn Godot's GDScript programming language from zero, right in your browser, for free.
https://gdquest.github.io/learn-gdscript/
Other
2.11k stars 159 forks source link

Can't scroll slowly with touchpad #779

Open TAPgiles opened 1 year ago

TAPgiles commented 1 year ago

I'm submitting a...

Bug report

On a chromebook, with browser version 103.0.5060.132, scrolling acts strangely.

What is the current behavior? It's way too sensitive to scrolling with my touchpad compared to normal page scrolling. Almost as if it's paging down at the smallest amount of scrolling down.

Using the arrow keys has a much smaller step and works fine. So it seems the code allows for more fine-grain scrolling, at least.

What is the expected behavior? Scrolling should be the same speed as scrolling any normal web page. Ideally just as smoothly as well. As it looks like the text tutorials at least function just like a web page, users would expect it to behave like one in this regard.

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem. Using a browser, go through to the first tutorial: What Code is Like, which is a text tutorial. Scroll up and down.

NathanLovato commented 1 year ago

Could you please tell us in which browser and with which device exactly? Could you try with a different web browser and see if it also occurs?

This is probably specific to either the browser on this device or the touchpad itself.

TAPgiles commented 1 year ago

It’s not modded, just a Chromebook. So the browser is Chrome 😉

The device is Acer chromebook 14 CB3-431. I’ll try on a different browser later maybe.

Calinou commented 1 year ago

This is likely an engine issue: https://github.com/godotengine/godot/issues/49873

NathanLovato commented 1 year ago

We have code here to throttle excessive events, and it's worked in Chrome (excessive scroll events would happen with every touchpad in chrome-based browsers specifically): https://github.com/GDQuest/learn-gdscript/blob/86545dec8fa04a8ca951cd7c95348ebd893d469e/ui/components/SmoothScrollContainer.gd#L91

But it doesn't seem to be working in this user's case. @Calinou do you know if there is something else we could try for them?

Calinou commented 1 year ago

@TAPgiles Could you record a video showing the screen when scrolling in the web app, then on any other website such as godotengine.org (for comparison)?

TAPgiles commented 1 year ago

Screen recording 2023-02-18 4.17.20 PM.webm

In the video, for each window, I tried very slow subtle scrolling. Then a faster swipe on the trackpad. Somehow in Learn to Code, slow scrolling goes in these huge chunks, compared to fast swipes where... I guess it still goes in huge chunks(?) but at least it feels better because I expect it to move larger amounts. But even then there's like a cap on how fast you can scroll making large swipes like that; it's slower than moving very subtly.

NathanLovato commented 1 year ago

Okay I see, the problem is that the scrolling doesn't account for how fast/far you move your fingers on the trackpad. Instead, it moves in fixed increments whenever it receives a mouse scroll event, as if you used a mouse wheel. That's roughly why it moves about the same if you do slow and short or fast and large swipes

I'll update the issue title accordingly.