diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 6 | ||||
-rw-r--r-- | scene/gui/item_list.cpp | 1 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 7 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
4 files changed, 14 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 50ffc0509c..68af7af5d4 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1563,6 +1563,12 @@ void Control::set_custom_minimum_size(const Size2 &p_custom) { if (p_custom == data.custom_minimum_size) { return; } + + if (isnan(p_custom.x) || isnan(p_custom.y)) { + // Prevent infinite loop. + return; + } + data.custom_minimum_size = p_custom; update_minimum_size(); } diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 82f089735d..c44feddd38 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1550,6 +1550,7 @@ bool ItemList::get_allow_reselect() const { } void ItemList::set_icon_scale(real_t p_scale) { + ERR_FAIL_COND(!Math::is_finite(p_scale)); icon_scale = p_scale; } diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index f26e05518e..d9f76a6fa6 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -150,7 +150,12 @@ RichTextLabel::Item *RichTextLabel::_get_item_at_pos(RichTextLabel::Item *p_item return it; } } break; - case ITEM_IMAGE: + case ITEM_IMAGE: { + offset += 1; + if (offset > p_position) { + return it; + } + } break; case ITEM_TABLE: { offset += 1; } break; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a96d85dffa..6d9e8a90c2 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -680,7 +680,7 @@ void TextEdit::_notification(int p_what) { } } - bool draw_placeholder = text.size() == 1 && text[0].length() == 0; + bool draw_placeholder = text.size() == 1 && text[0].is_empty() && ime_text.is_empty(); // Get the highlighted words. String highlighted_text = get_selected_text(0); |