Skip to content

Commit

Permalink
Disable scroll when dragging at edges of TextEdit
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Jun 14, 2022
1 parent cda6ea0 commit 053fdb8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scene/gui/text_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 053fdb8

Please sign in to comment.