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

Add scroll_area::State::velocity #3300

Merged
merged 4 commits into from
Sep 5, 2023
Merged

Add scroll_area::State::velocity #3300

merged 4 commits into from
Sep 5, 2023

Conversation

Barugon
Copy link
Contributor

@Barugon Barugon commented Sep 4, 2023

Add a method to State in order to check if a scroll area has momentum.

@emilk emilk added the egui label Sep 4, 2023

/// Returns true if the scroll area currently has a velocity due to momentum.
pub fn has_velocity(&self) -> bool {
self.vel.x != 0.0 || self.vel.y != 0.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also just return the current velocity, which gives the user a lot more info

@emilk emilk changed the title Scroll area momentum Add scroll_area::State::velocity Sep 5, 2023
@emilk emilk merged commit cf163cc into emilk:master Sep 5, 2023
18 checks passed
@Barugon Barugon deleted the momentum branch September 5, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants