فهرست منبع

Call minimum_size_changed() on redo/undo if expand_to_text_length is true

Fixes #28241
Carsten Klein 6 سال پیش
والد
کامیت
da2a0a3814
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      scene/gui/line_edit.cpp

+ 8 - 0
scene/gui/line_edit.cpp

@@ -918,6 +918,10 @@ void LineEdit::undo() {
 	TextOperation op = undo_stack_pos->get();
 	TextOperation op = undo_stack_pos->get();
 	text = op.text;
 	text = op.text;
 	set_cursor_position(op.cursor_pos);
 	set_cursor_position(op.cursor_pos);
+
+	if (expand_to_text_length)
+		minimum_size_changed();
+
 	_emit_text_change();
 	_emit_text_change();
 }
 }
 
 
@@ -932,6 +936,10 @@ void LineEdit::redo() {
 	TextOperation op = undo_stack_pos->get();
 	TextOperation op = undo_stack_pos->get();
 	text = op.text;
 	text = op.text;
 	set_cursor_position(op.cursor_pos);
 	set_cursor_position(op.cursor_pos);
+
+	if (expand_to_text_length)
+		minimum_size_changed();
+
 	_emit_text_change();
 	_emit_text_change();
 }
 }