Merge pull request #15308 from ianb96/horizontal_scrolling

TextEdit horizontal scrolling with shift
This commit is contained in:
Rémi Verschelde 2018-01-04 01:35:38 +01:00 committed by GitHub
commit 023c04689e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()));