Просмотр исходного кода

Reshape and update button on oversampling change.

bruvzg 1 год назад
Родитель
Сommit
41a1a7f94b
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      scene/gui/button.cpp

+ 7 - 0
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();