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

Make drag and drop autoscroll accelerate more near edges. #392

Merged
merged 5 commits into from
Jan 17, 2024

Conversation

Kiisu-Master
Copy link
Contributor

@Kiisu-Master Kiisu-Master commented Jan 15, 2024

In case someone is confused, here is a graph.
m is the autoscroll_area.
https://www.desmos.com/calculator/sipneqdwk0

@Kiisu-Master
Copy link
Contributor Author

Uhhh something is wrong with the safe margin.

@MewPurPur
Copy link
Owner

So this doesn't work correctly in your PR yet?

@Kiisu-Master
Copy link
Contributor Author

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...

@Kiisu-Master
Copy link
Contributor Author

Also i believe this can still be improved. Right now its linearly increasing and max speed depends on the size of the scroll container.

@Kiisu-Master
Copy link
Contributor Author

give me a moment i have an idea

@Kiisu-Master Kiisu-Master marked this pull request as draft January 15, 2024 22:46
@Kiisu-Master Kiisu-Master marked this pull request as ready for review January 16, 2024 09:16
@@ -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
Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Owner

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.

@MewPurPur
Copy link
Owner

Could you show a clip of how it looks?

@MewPurPur
Copy link
Owner

Tested it and I really like how it works!

@MewPurPur
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants