diff options
| author | toger5 | 2017-02-22 00:45:31 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2017-05-07 14:23:56 +0200 |
| commit | 304a1f5b5a3ce6975952f5cd22d688a246367790 (patch) | |
| tree | 14de7920daa3f90af91c668b3edcccdf439ed6f2 /editor/animation_editor.cpp | |
| parent | c8aea60324e3e219945a805f871363c10292f38b (diff) | |
| download | godot-304a1f5b5a3ce6975952f5cd22d688a246367790.tar.gz godot-304a1f5b5a3ce6975952f5cd22d688a246367790.tar.zst godot-304a1f5b5a3ce6975952f5cd22d688a246367790.zip | |
Implemented scrolling factor for smooth trackpad scrolling
Working platforms platform: OSX, Windows.
Support for almost all ui elements, including project list.
Diffstat (limited to 'editor/animation_editor.cpp')
| -rw-r--r-- | editor/animation_editor.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index 63ed27e60..1e6562fcf 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -1871,21 +1871,35 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent &p_input) { if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) { if (mb.mod.command) { + zoom->set_value(zoom->get_value() + zoom->get_step()); } else { - v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() / 8); + + v_scroll->set_value(v_scroll->get_value() - v_scroll->get_page() * mb.factor / 8); } } if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) { if (mb.mod.command) { + zoom->set_value(zoom->get_value() - zoom->get_step()); } else { - v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() / 8); + + v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * mb.factor / 8); } } + if (mb.button_index == BUTTON_WHEEL_RIGHT && mb.pressed) { + + h_scroll->set_value(h_scroll->get_value() - h_scroll->get_page() * mb.factor / 8); + } + + if (mb.button_index == BUTTON_WHEEL_LEFT && mb.pressed) { + + v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * mb.factor / 8); + } + if (mb.button_index == BUTTON_RIGHT && mb.pressed) { Point2 mpos = Point2(mb.x, mb.y) - ofs; |
