mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Fix GraphEdit mouse scroll axis.
maps BUTTON_WHEEL_UP/DOWN to vscroll of GraphEdit. maps KEY_SHIFT + BUTTON_WHEER_UP/DOWN to hscroll of GraphEdit.
This commit is contained in:
parent
0c82d113ed
commit
86bcbd5b15
@ -941,17 +941,17 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
|
||||
//too difficult to get right
|
||||
//set_zoom(zoom/ZOOM_SCALE);
|
||||
}
|
||||
if (b->get_button_index() == BUTTON_WHEEL_UP) {
|
||||
h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() * b->get_factor() / 8);
|
||||
if (b->get_button_index() == BUTTON_WHEEL_UP && !Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
|
||||
v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * b->get_factor() / 8);
|
||||
}
|
||||
if (b->get_button_index() == BUTTON_WHEEL_DOWN) {
|
||||
h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * b->get_factor() / 8);
|
||||
}
|
||||
if (b->get_button_index() == BUTTON_WHEEL_RIGHT) {
|
||||
if (b->get_button_index() == BUTTON_WHEEL_DOWN && !Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
|
||||
v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * b->get_factor() / 8);
|
||||
}
|
||||
if (b->get_button_index() == BUTTON_WHEEL_LEFT) {
|
||||
v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * b->get_factor() / 8);
|
||||
if (b->get_button_index() == BUTTON_WHEEL_RIGHT || (b->get_button_index() == BUTTON_WHEEL_DOWN && Input::get_singleton()->is_key_pressed(KEY_SHIFT))) {
|
||||
h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * b->get_factor() / 8);
|
||||
}
|
||||
if (b->get_button_index() == BUTTON_WHEEL_LEFT || (b->get_button_index() == BUTTON_WHEEL_UP && Input::get_singleton()->is_key_pressed(KEY_SHIFT))) {
|
||||
h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() * b->get_factor() / 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user