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

Drag scrolling (on macOS laptop with a retina display) is too fast #58

Open
dr2chase opened this issue Feb 17, 2022 · 4 comments
Open

Comments

@dr2chase
Copy link

There may be a way to adjust this, but I could not find it.

What I want is to scroll with drag gestures on my trackpad; this "works" but instead of scrolling a few lines, unless I am very careful with my drag motion, the contents of the window fly past too quickly.

I wonder if this is an interaction with the magnification/zoom for a retina display.

@aarzilli
Copy link
Owner

In vendor/github.com/aarzilli/nucular/gio.go there's a line that says mw.ctx.Input.Mouse.ScrollDelta++ (and --). I imagine the event that executes that gets generated many many times with the drag motion, for some reason. The zoom factor doesn't matter.

@dr2chase
Copy link
Author

I am not sure how to connect this to preferences or to automatically figure out if this would be a good idea, but this change helped with trackpad drag scrolling and seemed not to hurt anything else:

diff --git a/vendor/github.com/aarzilli/nucular/nucular.go b/vendor/github.com/aarzilli/nucular/nucular.go
index 7e4967c..f851cbc 100644
--- a/vendor/github.com/aarzilli/nucular/nucular.go
+++ b/vendor/github.com/aarzilli/nucular/nucular.go
@@ -1927,6 +1927,8 @@ func doScrollbarv(win *Window, scroll, scrollwheel_bounds rect.Rect, offset floa
        var scroll_off float64
        var scroll_ratio float64

+       step /= 4
+
        if scroll.W < 1 {
                scroll.W = 1
        }
@@ -2015,6 +2017,8 @@ func doScrollbarh(win *Window, scroll rect.Rect, offset float64, target float64,
        var scroll_off float64
        var scroll_ratio float64

+       step /= 4
+
        /* scrollbar background */
        if scroll.H < 1 {
                scroll.H = 1

@aarzilli
Copy link
Owner

Assuming the normalization that gio does is correct 6a21078 should be the right way to do it, is it too slow?

@dr2chase
Copy link
Author

That is not too slow -- it is better, but not slow enough. When I combined that with my step /=4 hack above, perhaps it is too slow, but only perhaps, not definitely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants