Skip to content

Commit 4186f57

Browse files
committed
Merge pull request #102344 from bruvzg/rtl_reg
[RTL] Fix updating region without updating texture.
2 parents e9af82f + 5b57904 commit 4186f57

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scene/gui/rich_text_label.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -3396,6 +3396,13 @@ void RichTextLabel::update_image(const Variant &p_key, BitField<ImageUpdateMask>
33963396
ItemImage *item = it_img;
33973397
if (p_mask & UPDATE_REGION) {
33983398
item->region = p_region;
3399+
if (!(p_mask & UPDATE_TEXTURE)) {
3400+
// Update existing atlas texture region, if texture is not updated.
3401+
Ref<AtlasTexture> atlas_tex = item->image;
3402+
if (atlas_tex.is_valid()) {
3403+
atlas_tex->set_region(item->region);
3404+
}
3405+
}
33993406
}
34003407
if (p_mask & UPDATE_TEXTURE) {
34013408
if (item->image.is_valid()) {

0 commit comments

Comments
 (0)