From bb85e11895ff570f4ce5d6f7affb153687546377 Mon Sep 17 00:00:00 2001 From: wisplite Date: Thu, 14 May 2026 10:15:23 -0500 Subject: [PATCH] finally make the zooming proportional so it isn't too fast when zooming out --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 7380cff..05347bd 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "image/color" + "math" "strconv" "strings" "unsafe" @@ -336,8 +337,8 @@ func main() { // 1. Where is the mouse in the world BEFORE zooming? worldPosBefore := rl.GetScreenToWorld2D(mousePos, camera) - // 2. Apply the zoom - camera.Zoom += float32(wheel) * 0.1 + // 2. Apply proportional zoom so wheel steps get smaller as the view zooms out. + camera.Zoom *= float32(math.Pow(1.1, float64(wheel))) if camera.Zoom < 0.01 { camera.Zoom = 0.01 }