Closed ForNeVeR closed 4 months ago
For now, we have a lot of copy-pasted fragments like this:
let struct (windowWidth, windowHeight) = window.WindowSizePx let struct (renderTargetWidth, renderTargetHeight) = window.RenderTargetSize let cameraTargetX = ((windowWidth |> float32) - (renderTargetWidth |> float32) * camera.zoom) / -2f / camera.zoom let cameraTargetY = ((windowHeight |> float32) - (renderTargetHeight |> float32) * camera.zoom) / -2f / camera.zoom camera.target <- Vector2(cameraTargetX, cameraTargetY) camera.zoom <- min ((windowHeight |> float32) / (renderTargetHeight |> float32)) ((windowWidth |> float32) / (renderTargetWidth |> float32))
We should extract that to a reusable function.
Closed by #151.
For now, we have a lot of copy-pasted fragments like this:
We should extract that to a reusable function.