-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Make drag and drop autoscroll accelerate more near edges. #392
Conversation
Uhhh something is wrong with the safe margin. |
So this doesn't work correctly in your PR yet? |
It works fine. I just noticed that for some weird reason the zone in which autoscroll starts isn't of the correct size ( 1 / 6 ). It's a bit bigger, but also not twice as big. Idk why it is like that... |
Also i believe this can still be improved. Right now its linearly increasing and max speed depends on the size of the scroll container. |
give me a moment i have an idea |
src/ui_parts/tag_container.gd
Outdated
@@ -1,6 +1,8 @@ | |||
extends PanelContainer | |||
|
|||
const safe_margin = 1 / 6.0 | |||
# Autoscroll area on drag and drop. As a factor from edge to center. | |||
const safe_margin := 1.0 / 2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe i should rename the variable... its not exactly the safe margin.
Its the scroll area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
Are you sure about 1/2? Seems quite extreme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1/2 is actually 1/4 of the scroll container height.
Also keep in mind scrolling is slower near the center.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, and I know, but it seems extreme nonetheless. You normally only have scrolling towards the very edges, the central part is for dropping things without repercussions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tweaked it from 1/2 to 1/3, it seemed_ best to me that way. With 1/2, I had situations where I grab a tag and it immediately starts scrolling.
Could you show a clip of how it looks? |
Tested it and I really like how it works! |
Thanks! |
In case someone is confused, here is a graph.
m is the
autoscroll_area
.https://www.desmos.com/calculator/sipneqdwk0