Browse Source

Merge pull request #46024 from kleonc/rtl_add_image_fix

RichTextLabel::add_image Fail if passed image has no area
Rémi Verschelde 4 năm trước cách đây
mục cha
commit
f5f3f440f1
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      scene/gui/rich_text_label.cpp

+ 2 - 0
scene/gui/rich_text_label.cpp

@@ -2253,6 +2253,8 @@ void RichTextLabel::add_image(const Ref<Texture2D> &p_image, const int p_width,
 	}
 
 	ERR_FAIL_COND(p_image.is_null());
+	ERR_FAIL_COND(p_image->get_width() == 0);
+	ERR_FAIL_COND(p_image->get_height() == 0);
 	ItemImage *item = memnew(ItemImage);
 
 	item->image = p_image;