TextEdit: When left mouse is pressed to place the cursor, do not immediately adjust the viewport when cursor_set_line is called, but afterwards on cursor_set_column (effectively when the cursor reached its final position)

Fixes #45770

(cherry picked from commit 8d598693fc)
This commit is contained in:
Oliver Dick 2021-02-07 00:28:57 +01:00 committed by Rémi Verschelde
parent 3abe6ae281
commit db57f32194
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2389,7 +2389,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
int prev_col = cursor.column;
int prev_line = cursor.line;
cursor_set_line(row, true, false);
cursor_set_line(row, false, false);
cursor_set_column(col);
if (mb->get_shift() && (cursor.column != prev_col || cursor.line != prev_line)) {