Explorar o código

Fixed issues with LineEdit Delete Word & Backspace Word.

Backspace word was deleting all text before the cursor, and delete word was no updating until another action was performed on the LineEdit (in order to update it)
EricEzaM %!s(int64=4) %!d(string=hai) anos
pai
achega
de5387ab82
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      scene/gui/line_edit.cpp

+ 2 - 0
scene/gui/line_edit.cpp

@@ -155,6 +155,7 @@ void LineEdit::_backspace(bool p_word, bool p_all_to_left) {
 		for (int i = words.size() - 1; i >= 0; i--) {
 			if (words[i].x < cc) {
 				cc = words[i].x;
+				break;
 			}
 		}
 
@@ -202,6 +203,7 @@ void LineEdit::_delete(bool p_word, bool p_all_to_right) {
 		}
 
 		delete_text(caret_column, cc);
+		set_caret_column(caret_column);
 	} else {
 		if (caret_mid_grapheme_enabled) {
 			set_caret_column(caret_column + 1);