From 053fdb88722dbf9c7cea9190dc4cbef491e448a5 Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 14 Jun 2022 23:36:54 +0200 Subject: [PATCH] Disable scroll when dragging at edges of TextEdit --- scene/gui/text_edit.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 037665c8a29..d1ea16cb263 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2764,10 +2764,12 @@ void TextEdit::_gui_input(const Ref &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();