From 5b57904bef74a8435d8429da47e6558e13152046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Mon, 3 Feb 2025 00:06:55 +0200 Subject: [PATCH] [RTL] Fix updating region without updating texture. --- scene/gui/rich_text_label.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 6475dc50e8e..c22d4151183 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -3397,6 +3397,13 @@ void RichTextLabel::update_image(const Variant &p_key, BitField ItemImage *item = it_img; if (p_mask & UPDATE_REGION) { item->region = p_region; + if (!(p_mask & UPDATE_TEXTURE)) { + // Update existing atlas texture region, if texture is not updated. + Ref atlas_tex = item->image; + if (atlas_tex.is_valid()) { + atlas_tex->set_region(item->region); + } + } } if (p_mask & UPDATE_TEXTURE) { if (item->image.is_valid()) {