1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Implemented scrolling factor for smooth trackpad scrolling

Working platforms platform: OSX, Windows.
Support for almost all ui elements, including project list.

Ported from 304a1f5b5a (#7864).
Fixes #492 and #3913.
This commit is contained in:
Sean Bohan
2017-05-13 12:02:26 +08:00
parent e7328fe5a0
commit ee670f3724
15 changed files with 111 additions and 67 deletions

View File

@@ -523,10 +523,10 @@ void Polygon2DEditor::_uv_input(const InputEvent &p_input) {
} else if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) {
uv_zoom->set_val(uv_zoom->get_val() / 0.9);
uv_zoom->set_val(uv_zoom->get_val() / (1 - (0.1 * mb.factor)));
} else if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) {
uv_zoom->set_val(uv_zoom->get_val() * 0.9);
uv_zoom->set_val(uv_zoom->get_val() * (1 - (0.1 * mb.factor)));
}
} else if (p_input.type == InputEvent::MOUSE_MOTION) {