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 uninitialized Y-sort modulate for CanvasItems #78134

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Jun 12, 2023

Fix #78035.

All MRPs I've tested in #77079 had top most Y-sorted item without actual visuals so haven't noticed that such root CanvasItem's ysort_modulate remains not initialized to Color(1, 1, 1, 1). And I must have not tested the simplest case of a single Y-sorted node. 🤦‍♂️

Marking as cherrypick:4.0 as #77079 is still labelled as such.

@kleonc kleonc force-pushed the y-sort-initialize-modulate branch from 7d3d39a to bbb2a88 Compare June 12, 2023 11:41
@akien-mga akien-mga changed the title Fix unitialized Y-sort modulate for CanvasItems Fix uninitialized Y-sort modulate for CanvasItems Jun 12, 2023
@kleonc
Copy link
Member Author

kleonc commented Jun 12, 2023

@akien-mga Actually, initializing ysort_modulate to Color(1, 1, 1, 1) was not a proper fix. It can remain uninitialized for not y-sorted items, that's not a problem. It only needs to additionally be set for the y-sorted branch-root CanvasItem and it needs to be done each time y-sorting is being resolved. When only initializing such branch-root could end up having modulation different than Color(1, 1, 1, 1) after some y-sorting toggling and modulation changes. Rebased with should-be-a-proper-fix.

@akien-mga akien-mga merged commit 66423d4 into godotengine:master Jun 12, 2023
@akien-mga
Copy link
Member

Thanks!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.4 together with #77079.

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.

2D Sprites rendered black with enabled Y-sorting
3 participants