소스 검색

Merge pull request #102344 from bruvzg/rtl_reg

[RTL] Fix updating region without updating texture.
Thaddeus Crews 7 달 전
부모
커밋
4186f57fe8
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      scene/gui/rich_text_label.cpp

+ 7 - 0
scene/gui/rich_text_label.cpp

@@ -3396,6 +3396,13 @@ void RichTextLabel::update_image(const Variant &p_key, BitField<ImageUpdateMask>
 				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<AtlasTexture> 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()) {