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

Refactor ColorPicker shapes #99515

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Nov 21, 2024

Closes godotengine/godot-proposals#4353
Basically #62075, but for picker shapes.

Adds a new class ColorPickerShape, which is an abstraction of picker shapes (similar to ColorMode). This allows to split some behemoth methods into a more manageable pieces. For now I removed the huge _hsv_draw() method, which had entangled code for drawing every piece of ColorPicker. Now each part has its own method. The shapes should appear as before.

@KoBeWi KoBeWi force-pushed the shapez.godot branch 2 times, most recently from 029beba to 04e059f Compare December 1, 2024 22:47
@KoBeWi
Copy link
Member Author

KoBeWi commented Dec 1, 2024

I reimplemented the input. The shapes should behave the same as before.
Feel free to test, I'm not sure if deferred mode is done correctly.

I'll be probably changing the shapes to be Object, because the current code is far from ideal and the little saved memory is not worth it.

@KoBeWi KoBeWi force-pushed the shapez.godot branch 3 times, most recently from 42c56a6 to dd5783d Compare December 6, 2024 15:02
@KoBeWi KoBeWi marked this pull request as ready for review December 6, 2024 15:03
@KoBeWi KoBeWi requested a review from a team as a code owner December 6, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor ColorPicker
1 participant