-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Increase precision of RAW mode in ColorPicker #83851
Increase precision of RAW mode in ColorPicker #83851
Conversation
This sets the slider step to `0.001` but keeps SpinBox arrow increments at `0.01`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserving the precision is a good goal.
Just as I imagined it 👍 |
@@ -43,6 +43,7 @@ class ColorMode { | |||
|
|||
virtual int get_slider_count() const { return 3; }; | |||
virtual float get_slider_step() const = 0; | |||
virtual float get_spinbox_arrow_step() const { return get_slider_step(); }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also be const = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking it should have a default value so that individual color modes aren't required to implement this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is the default value for SpinBox.custom_arrow_step, it will be ignored. From docs:
float custom_arrow_step = 0.0
If not 0, value will always be rounded to a multiple of custom_arrow_step when interacting with the arrow buttons of the SpinBox.
But defining it explicitly doesn't hurt either, I'm happy either way 🙂
Thanks! |
This sets the slider step to
0.001
but keeps SpinBox arrow increments at0.01
.Thanks @aXu-AP for the suggested fix 🙂
Preview
simplescreenrecorder-2023-10-23_18.32.31.mp4