diff options
author | toger5 <toger5@hotmail.de> | 2017-09-19 01:30:46 +0200 |
---|---|---|
committer | toger5 <toger5@hotmail.de> | 2017-09-19 02:34:04 +0200 |
commit | 1a8a80368edb544780878ff4fd3d650024f5e60e (patch) | |
tree | 69366601191d0115f51bd45f387f6c9b31f1293a | |
parent | 81245a634b9dff041b0f2373c643166267a03857 (diff) |
added precision scrolling to spatial editor zoom
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index f50e792178..69c5cd1a28 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -799,15 +799,15 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> b = p_event; if (b.is_valid()) { - + float zoom_factor = 1 + (ZOOM_MULTIPLIER - 1) * b->get_factor(); switch (b->get_button_index()) { case BUTTON_WHEEL_UP: { - scale_cursor_distance(is_freelook_active() ? ZOOM_MULTIPLIER : 1.0 / ZOOM_MULTIPLIER); + scale_cursor_distance(is_freelook_active() ? zoom_factor : 1.0 / zoom_factor); } break; case BUTTON_WHEEL_DOWN: { - scale_cursor_distance(is_freelook_active() ? 1.0 / ZOOM_MULTIPLIER : ZOOM_MULTIPLIER); + scale_cursor_distance(is_freelook_active() ? 1.0 / zoom_factor : zoom_factor); } break; case BUTTON_RIGHT: { |