Merge pull request #286 from Calinou/allow-mouse-wheel-rotate-anim

Don't stop the 3D preview rotation animation when zooming in or out
This commit is contained in:
Rodz Labs 2021-03-03 20:01:44 +01:00 committed by GitHub
commit 7401f748a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -122,7 +122,10 @@ func get_materials() -> Array:
func on_gui_input(event) -> void:
if event is InputEventMouseButton:
$MaterialPreview/Preview3d/ObjectRotate.stop(false)
if event.button_index == BUTTON_LEFT or event.button_index == BUTTON_RIGHT or event.button_index == BUTTON_MIDDLE:
# Don't stop rotating the preview on mouse wheel usage (zoom change).
$MaterialPreview/Preview3d/ObjectRotate.stop(false)
match event.button_index:
BUTTON_WHEEL_UP:
camera.translation.z = clamp(