summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-01-04 01:35:38 +0100
committerGitHub <noreply@github.com>2018-01-04 01:35:38 +0100
commit023c04689e176d1669a34619e9624d817aa5e33e (patch)
treefe88d2f7952903576ae03ebb246b94f8b62b6634
parent2870ffe44347cf6012f1264907d744d8968bfbf4 (diff)
parentae6b7c0b419d59d2e24a3f049c69510e44fa82ce (diff)
Merge pull request #15308 from ianb96/horizontal_scrolling
TextEdit horizontal scrolling with shift
-rw-r--r--scene/gui/text_edit.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 9247fc943b..87043c65eb 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1822,10 +1822,18 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (mb->is_pressed()) {
if (mb->get_button_index() == BUTTON_WHEEL_UP && !mb->get_command()) {
- _scroll_up(3 * mb->get_factor());
+ if (mb->get_shift()) {
+ h_scroll->set_value(h_scroll->get_value() - (100 * mb->get_factor()));
+ } else {
+ _scroll_up(3 * mb->get_factor());
+ }
}
if (mb->get_button_index() == BUTTON_WHEEL_DOWN && !mb->get_command()) {
- _scroll_down(3 * mb->get_factor());
+ if (mb->get_shift()) {
+ h_scroll->set_value(h_scroll->get_value() + (100 * mb->get_factor()));
+ } else {
+ _scroll_down(3 * mb->get_factor());
+ }
}
if (mb->get_button_index() == BUTTON_WHEEL_LEFT) {
h_scroll->set_value(h_scroll->get_value() - (100 * mb->get_factor()));