From 41a1a7f94becabae9e2aab41790735393e69f6ef Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:42:59 +0300 Subject: [PATCH] Reshape and update button on oversampling change. --- scene/gui/button.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 0a5f2ec6c74..bfd5c075cfa 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -210,6 +210,13 @@ void Button::_notification(int p_what) { } break; case NOTIFICATION_DRAW: { + // Reshape and update size min. if text is invalidated by an external source (e.g., oversampling). + if (text_buf.is_valid() && !TS->shaped_text_is_ready(text_buf->get_rid())) { + _shape(); + + update_minimum_size(); + } + const RID ci = get_canvas_item(); const Size2 size = get_size();