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

Negative values don't work #36

Open
maxp-hover opened this issue Dec 11, 2023 · 0 comments
Open

Negative values don't work #36

maxp-hover opened this issue Dec 11, 2023 · 0 comments

Comments

@maxp-hover
Copy link

maxp-hover commented Dec 11, 2023

If I use a params object like this:

{
  val: -1,
  valMin: -5,
  valMax: 0,
  valStep: 0.1
}

The interface doesn't work properly. The minimum value for the slider works, but not the maximum. The slider goes all the way up to 100 (the default behavior, I believe), not to 0 as I specified.

I might suggest a refactor which internally makes all sliders go from 0 to 1, then implements a remapping function which takes those values and remaps them to the user-specified range. This would solve the issue I mentioned above, but also handle situations where the user provided "min" is greater than the "max". Though not technically correct in a mathematical sense, a user might want bigger values to be on the left side of the slider, and the library might as well support that.

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

1 participant