diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-12-12 09:31:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 09:31:33 +0100 |
commit | 8c045fc9ff8101a3581045ed4baa02565850aebd (patch) | |
tree | 1409320d24f2e007ff9177ac4fed7622ba66b7f7 /scene/gui/text_edit.cpp | |
parent | 7195f6b973f098f2404e0afd575bf2428acebb5a (diff) | |
parent | 2d4ef1c193d57e8af4175564845a01a6fff0eff4 (diff) |
Merge pull request #44288 from Chaosus/fix_textedit_scrolling
Fixed mouse scrolling in TextEdit's
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 6b16806789..1d65abc95f 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1650,7 +1650,7 @@ void TextEdit::_notification(int p_what) { if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID) { DisplayServer::get_singleton()->window_set_ime_active(true, get_viewport()->get_window_id()); - DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + _get_cursor_pixel_pos(), get_viewport()->get_window_id()); + DisplayServer::get_singleton()->window_set_ime_position(get_global_position() + _get_cursor_pixel_pos(false), get_viewport()->get_window_id()); } if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) { @@ -2072,8 +2072,10 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co r_col = col; } -Vector2i TextEdit::_get_cursor_pixel_pos() { - adjust_viewport_to_cursor(); +Vector2i TextEdit::_get_cursor_pixel_pos(bool p_adjust_viewport) { + if (p_adjust_viewport) { + adjust_viewport_to_cursor(); + } int row = 1; for (int i = get_first_visible_line(); i < cursor.line; i++) { if (!is_line_hidden(i)) { |