Fix GradientTexture2D update after setting the gradient

This commit is contained in:
Hendrik Brucker 2022-04-19 19:51:49 +02:00
parent 690fefe43e
commit 39a4036aa2

View file

@ -2278,6 +2278,8 @@ Ref<Image> GradientTexture1D::get_image() const {
return RenderingServer::get_singleton()->texture_2d_get(texture);
}
//////////////////
GradientTexture2D::GradientTexture2D() {
_queue_update();
}
@ -2299,7 +2301,8 @@ void GradientTexture2D::set_gradient(Ref<Gradient> p_gradient) {
if (gradient.is_valid()) {
gradient->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GradientTexture2D::_queue_update));
}
_queue_update();
_update();
emit_changed();
}
Ref<Gradient> GradientTexture2D::get_gradient() const {