Merge pull request #61980 from KoBeWi/obliterate_scroll

Disable scroll when dragging at edges of TextEdit
This commit is contained in:
Rémi Verschelde 2022-06-14 23:47:17 +02:00 committed by GitHub
commit 0c5c5381d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -2764,10 +2764,12 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
_get_mouse_pos(Point2i(mp.x, mp.y), row, col);
cursor_set_line(row, true);
cursor_set_column(col);
if (row <= get_first_visible_line()) {
_scroll_lines_up();
} else if (row >= get_last_full_visible_line()) {
_scroll_lines_down();
if (!scroll_past_end_of_file_enabled) {
if (row <= get_first_visible_line()) {
_scroll_lines_up();
} else if (row >= get_last_full_visible_line()) {
_scroll_lines_down();
}
}
dragging_selection = true;
update();