Merge pull request #90055 from Sauermann/fix-add-tbg-check

Add early return when setting `transparent_bg`
This commit is contained in:
Rémi Verschelde 2024-04-04 14:36:54 +02:00
commit 550f5a577f
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 0 deletions

View File

@ -1191,6 +1191,9 @@ void RendererViewport::viewport_set_canvas_transform(RID p_viewport, RID p_canva
void RendererViewport::viewport_set_transparent_background(RID p_viewport, bool p_enabled) {
Viewport *viewport = viewport_owner.get_or_null(p_viewport);
ERR_FAIL_NULL(viewport);
if (viewport->transparent_bg == p_enabled) {
return;
}
RSG::texture_storage->render_target_set_transparent(viewport->render_target, p_enabled);
viewport->transparent_bg = p_enabled;