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

Wrong step increment for number slider #141

Closed
vkuchinov opened this issue Jun 16, 2024 · 2 comments
Closed

Wrong step increment for number slider #141

vkuchinov opened this issue Jun 16, 2024 · 2 comments
Milestone

Comments

@vkuchinov
Copy link

Here is a small piece of code:

const gui = new GUI(); const params = { num: 2760 }; gui.add(params, 'num', 2200, 3000, 80);

The slider should consists of numbers starting from 2200 to 3000 with a step of 80, however it twists the sequence from its second number [2200, 2240, ... 3000], while it has to be [2200, 2280, ... 3000].

The right sequence which has to be at slider is 2200, 2280, 2360, 2440, 2520, 2600, 2680, 2760, 2840, 2920, 3000.

I have tried to set a step parameters with gui.add(params, 'num', 2200, 3000, 80).step(80); with same glitchy result.

@georgealways
Copy link
Owner

Hi! Thanks for reporting this. Right, I think this is because the range you're giving isn't divisible by step. But the desired behavior you're describing is very reasonable. I'll look into this.

Thanks! -g

@georgealways georgealways added this to the 0.19.2-dev milestone Jun 19, 2024
@georgealways
Copy link
Owner

Step increments will start at min as of 0.20.0.

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