-
-
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
Use cached hue for color picker when saturation is 0 #77863
Conversation
It seems you're a first time contributor, so welcome! To ensure you can pass style checks from CI, we recommend running checks locally, using the tools described in https://docs.godotengine.org/en/latest/contributing/development/code_style_guidelines.html Once the PR is ready, we'd typically ask you to squash the commits into one, you can see PR workflow for details. Contributors familiar with the ColorPicker will review this as time permits. |
Seems like this doesn't work correctly 🤔 fNb3gnZONT.mp4The saturation bar is always red when it's 0 and changing to different color mode and back resets the hue slider. tbh I don't see any difference from the previous behavior. Also I think the change could be done in ColorModeHSV class. We should avoid hard-coding mode-specific code in ColorPicker if possible. |
Ok I shall make these changes immediately. |
On second thought, I don't think its possible to completely isolate the fix in ColorModeHSV. This is because in color_picker, the slider values are updated using
But I'm not sure if that is a good idea if we wanted to isolate the fix in ColorModeHSV... Update: It may be a horrible idea to add new functionality only to ColorModeHSV... so I think a hacky solution may be to store the cached hue in the |
dfef7c1
to
b33ca3e
Compare
I have fixed the issue with the slider color and the changing of hues when the color mode is changed. I've isolated most of the behavior in If someone may review my code and make sure everything is okay, that would be great ;) |
You can change a member inside const function if it has |
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.
Works correctly now.
The special case you added is next to another special case, so it's probably fine.
Left 2 style comments that need to be addressed.
You need to squash commits into 1. Also accepting changes from GitHub added me as co-author, so you need to remove that. |
2842246
to
52f9e6e
Compare
just squashed it all into one! Thank you very much! |
52f9e6e
to
a374c7d
Compare
I pushed a small update amending the commit message to make it more explicit about the bug being fixed. |
Thanks! And congrats for your first merged Godot contribution 🎉 |
Hue is cached when the saturation in hsv mode is nonzero. When the saturation is 0, the cached hue is set as the slider in
_update_color
. This is to prevent #76968 from happening.Fixes #76968