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

Don't rebroadcast redundant slider messages #1114

Merged
merged 3 commits into from
Nov 16, 2021

Conversation

tarkah
Copy link
Member

@tarkah tarkah commented Nov 11, 2021

Updates Slider to only broadcast on_change when the Slider value actually changes from it's previous value. I noticed a ton of redundant messages being broadcast for the same slider value (probably due to high DPI mouse). This causes the slider to become very laggy when driving a computationally heavy change.

Slider is now buttery smooth!

@hecrj hecrj added the improvement An internal improvement label Nov 15, 2021
@hecrj hecrj added this to the 0.4.0 milestone Nov 15, 2021
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Looks great!

I have made a small change to use the value in Slider instead of introducing a new previous field in State. This way, we properly handle the scenario where the value may be changing from a different part of the GUI.

Let me know what you think!

@tarkah
Copy link
Member Author

tarkah commented Nov 15, 2021

Yup, that makes a lot more sense! Looks great.

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

Successfully merging this pull request may close these issues.

2 participants