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

Ctrl+click on Drag/Sliders ignores min/max #946

Closed
ljmoyn opened this issue Dec 20, 2016 · 6 comments
Closed

Ctrl+click on Drag/Sliders ignores min/max #946

ljmoyn opened this issue Dec 20, 2016 · 6 comments

Comments

@ljmoyn
Copy link

ljmoyn commented Dec 20, 2016

The ctrl + click option to turn sliders into an input is really handy, but it doesn't respect the slider range. I ran into a problem with this because I have a slider that is controlling an array index, so it can't go out of range. It would be nice if the values were clamped, so that if the input value is less than the min it would automatically get set to the min, and similarly for the max.

Also, I just want to say thanks for all the hard work on this. Imgui is awesome. I'm in the process of converting a qt project, and I'm loving it.

@unpacklo
Copy link

I would just like to say that I think the way it works right now is a good feature. It's very nice to have an escape hatch to go to a value that isn't typical, but still necessary.

Wouldn't clamping the value yourself work?

@ocornut
Copy link
Owner

ocornut commented Dec 20, 2016

As rolfraging pointed out, this is intended behavior to get maximum flexibility.
Also read in #413
You can clamp manually if you absolutely need to. Otherwise I would like to add an extra flag to request this behavior but SliderXX dont have rooms for flags at the moment.

@ljmoyn
Copy link
Author

ljmoyn commented Dec 21, 2016

I see. Thanks for the quick response, and the link.

@ocornut ocornut changed the title ctrl + click on sliders ignores min/max Ctrl+click on Drag/Sliders ignores min/max May 7, 2020
@ocornut
Copy link
Owner

ocornut commented May 7, 2020

Closing this as duplicate of, moving to #1829

@ocornut ocornut closed this as completed May 7, 2020
@ocornut
Copy link
Owner

ocornut commented May 7, 2020

Closing this as duplicate of, moving to #1829

@ocornut
Copy link
Owner

ocornut commented Sep 25, 2020

FYI renamed ImGuiDragFlags_ClampOnInput to ImGuiSliderFlags_AlwaysClamp.

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

No branches or pull requests

3 participants