Przeglądaj źródła

Fix inverted zoom direction

+ Update "How to play" in Readme
wullewutz 2 lat temu
rodzic
commit
b00bf24595
2 zmienionych plików z 4 dodań i 2 usunięć
  1. 2 0
      README.md
  2. 2 2
      src/camera.rs

+ 2 - 0
README.md

@@ -19,3 +19,5 @@ Use A and D to rotate ship.
 LeftShift to increase main engine thrust.
 LeftCtrl to decrease main engine thrust.
 X to shut down main engine completely.
+
+I/O or Mouseweel to zoom in/out.

+ 2 - 2
src/camera.rs

@@ -44,8 +44,8 @@ fn zoom_with_mousewheel(
     let mut projection = q.single_mut();
     for ev in scroll_evr.read() {
         match ev.unit {
-            MouseScrollUnit::Line => projection.scale += ZOOM_SPEED_WHEEL * ev.y,
-            MouseScrollUnit::Pixel => projection.scale += ZOOM_SPEED_WHEEL * ev.y,
+            MouseScrollUnit::Line => projection.scale -= ZOOM_SPEED_WHEEL * ev.y,
+            MouseScrollUnit::Pixel => projection.scale -= ZOOM_SPEED_WHEEL * ev.y,
         }
         projection.scale = projection.scale.clamp(0.2, 5000.);
     }