Skip to content

Commit

Permalink
Fix GradientTexture2D update after setting the gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometror committed Apr 19, 2022
1 parent 690fefe commit 39a4036
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scene/resources/texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,8 @@ Ref<Image> GradientTexture1D::get_image() const {
return RenderingServer::get_singleton()->texture_2d_get(texture);
}

//////////////////

GradientTexture2D::GradientTexture2D() {
_queue_update();
}
Expand All @@ -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 {
Expand Down

0 comments on commit 39a4036

Please sign in to comment.