summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/root.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/root.zig b/src/root.zig
index 8312f5d..00a56ad 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -126,6 +126,11 @@ pub fn update() !void {
// at same time and im not yak shavin this
if (rl.IsMouseButtonDown(rl.MOUSE_BUTTON_RIGHT)) {
const delta = rl.GetMouseDelta();
+ var scale = @log2(@abs(delta.x) + @abs(delta.y));
+ if (delta.x == 0.0 and delta.y == 0.0) {
+ scale = 1.0;
+ }
+
context.camera.target.x -= delta.x / zoom_scale;
context.camera.target.y -= delta.y / zoom_scale;
}