Added Ctrl + Middle Click Zoom Shortcut

This should make zooming in and out a bit easier for tablet users (such
as myself.)
This commit is contained in:
Eoin O'Neill
2019-01-23 19:43:56 -08:00
parent c56e1b1b36
commit 9f4b4dbfab
+11 -4
View File
@@ -31,12 +31,17 @@ class ArcBallCamera extends iron.Trait {
}
if (mouse.down("middle") || (mouse.down("right") && kb.down("space"))) {
redraws = 2;
camera.transform.loc.addf(-mouse.movementX / 150, 0.0, mouse.movementY / 150);
camera.buildMatrix();
if (kb.down("control")) {
redraws = 2;
camera.transform.move(camera.look(), mouse.movementX / 75);
} else {
redraws = 2;
camera.transform.loc.addf(-mouse.movementX / 150, 0.0, mouse.movementY / 150);
camera.buildMatrix();
}
}
if (mouse.down("right") || (mouse.down("left") && kb.down("control"))) {
if ((mouse.down("right") && !kb.down("space")) || (mouse.down("left") && kb.down("control"))) {
redraws = 2;
// Rotate X
@@ -58,6 +63,8 @@ class ArcBallCamera extends iron.Trait {
}
}
}