-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 consistency of GradientTexture changes #81137
Conversation
Just for future readers, this except comes from #60361. |
The interesting part is that this change wasn't done in GradientTexture1D. |
Thanks! |
Does this PR supersede #80855? |
Yes. |
Some leftovers (for whatever reason it's connecting to godot/scene/resources/gradient_texture.cpp Lines 66 to 72 in bc88dca
|
Gradient texture queues an update when a property changes, EXCEPT in
set_gradient()
in GradientTexture2D, which calls the update immediately and emits the changed signal twice. Another weird thing is that gradient texture changes would queue the update and the changed signal would be emitted in the_update()
method. That's not how this signal works.This PR removes the inconsistency and
_queue_update()
is now called for every change, but the deferredemit_changed()
is removed. Instead the signal is emitted right in the setter. I also added a public (not exposed) methodupdate_now()
, which forces the pending texture update to be done right now. It's automatically called when you attempt to get the image.