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

[Request] Scrolling element using scroll button #422

Closed
igorsegallafa opened this issue Mar 1, 2023 · 5 comments
Closed

[Request] Scrolling element using scroll button #422

igorsegallafa opened this issue Mar 1, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@igorsegallafa
Copy link
Contributor

It would be great if we could scroll the element when pressing the scroll button.

@igorsegallafa
Copy link
Contributor Author

igorsegallafa commented Mar 1, 2023

I did a PR just for testing purpose. It works really similar for the feature that I mentioned here, but I'm still have some doubts how the RmlUi Core works. I have to find the properly way to do it.

@mikke89 mikke89 added the enhancement New feature or request label Mar 2, 2023
@igorsegallafa
Copy link
Contributor Author

igorsegallafa commented Mar 6, 2023

We can let this issue open and close when we deal with these items:

  • The minimum scroll speed is 1px/frame. This can actually be quite fast, depending on DPI and FPS. We could accumulate subpixel movement, and submit them once they are greater than one.
  • It feels very sensitive near the reference, while opposite far away from the reference. Maybe it would feel better with a nonlinear speed vs distance? Try to square it? And perhaps add a deadzone near zero. This is mostly about tuning and feeling, we can tune this more later on as well.

mikke89 added a commit that referenced this issue Mar 14, 2023
…axis scrolling, use quadratic velocity model with deadzone for improved feeling, see #422
@mikke89
Copy link
Owner

mikke89 commented Mar 14, 2023

Hey, I've made some effort at improving this further. I've added a deadzone, quadratic distance-velocity model, two-axis scrolling, and subpixel velocity. I also refactored it a bit, and figured this feature is called autoscroll elsewhere, so I try to use that name consistently now.

Can you test it, and let me know how it works and feels for you?

@igorsegallafa
Copy link
Contributor Author

Oooh pretty cool, the auto scroll looks smoother for me and the code is very understandable. LGTM!
Do you think we can mark this issue as completed?

@mikke89
Copy link
Owner

mikke89 commented Mar 17, 2023

Cheers, glad you like it!

Yeah, let's consider this done. I'm also working on smooth scrolling while we're at it, so keep an eye out for that. I'll ping you for some feedback when it's done if you don't mind :)

@mikke89 mikke89 closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants