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

Fix Gradient Editor bugs #70548

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

MewPurPur
Copy link
Contributor

@MewPurPur MewPurPur commented Dec 25, 2022

Ho ho ho HOOO! My Christmas gift for Godot.

  • Fixes click detection bugs from Fixes and improvements to Gradient preview #68964. I ho-ho-hope this is the only regression.
  • Fixes gradient point deselecting when you double-click the color selector.
  • Fixes the color of new points not always being the one the user ho-ho-hovers.

Info for reviewers:

  • Mostly whitespace changes, dw.
  • Click detection bugs were fixed by accounting for the handles' widths in a few more places. This is because the ramp itself is offset by half a handle width so a handle at offset 0 stays inside the preview.
  • Gradient point deselecting on color picker double click was fixed by moving the double click code after the single click one.
  • Samples the offset directly, so there will be no inconsistencies from different interpolation modes and other reasons.

@Chaosus Chaosus added this to the 4.0 milestone Dec 26, 2022
@MewPurPur MewPurPur force-pushed the fix-some-gradient-jank branch 3 times, most recently from 6a1a2cf to 924b1c5 Compare December 26, 2022 21:35
editor/plugins/gradient_editor.cpp Outdated Show resolved Hide resolved
editor/plugins/gradient_editor.cpp Outdated Show resolved Hide resolved
@MewPurPur MewPurPur force-pushed the fix-some-gradient-jank branch from 924b1c5 to 905224e Compare January 23, 2023 06:56
Copy link
Member

@kleonc kleonc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@MewPurPur MewPurPur force-pushed the fix-some-gradient-jank branch from 905224e to b7b4133 Compare January 23, 2023 11:05
@MewPurPur
Copy link
Contributor Author

MewPurPur commented Jan 23, 2023

Slipped in a fix for the rects missing pixels too (just change from line primitives to 1px lines, shouldn't need re-reviewing) because they made the gradient editor literally unplayable (/joke)

This has been mentioned in #58775, although the broader problem of missing pixels when drawing unfilled rects with line primitives remains.

@akien-mga akien-mga merged commit 9937915 into godotengine:master Jan 23, 2023
@akien-mga
Copy link
Member

Thanks!

@MewPurPur MewPurPur deleted the fix-some-gradient-jank branch January 23, 2023 11:49
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.

4 participants