From 5069ef5487035faa3a89b31bf29c428da230b079 Mon Sep 17 00:00:00 2001 From: Radioactivity <85001747+voidwyrm-2@users.noreply.github.com> Date: Fri, 25 Jul 2025 15:50:18 -1000 Subject: Testing mouse positions --- src/main.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.zig b/src/main.zig index 3aa5c1f..7271824 100644 --- a/src/main.zig +++ b/src/main.zig @@ -520,10 +520,10 @@ const ScreenMainMenu = struct { rl.beginMode2D(self.camera); defer rl.endMode2D(); - const msp = rl.getMousePosition(); + const msp = rl.getMousePosition().scale(1 / self.camera.zoom); - const x = msp.x / (cells_width * cells_height); - const y = msp.y / (cells_width * cells_height); + const x = msp.x / cell_size; + const y = msp.y / cell_size; rl.drawRectangleRec(rl.Rectangle.init(x, y, 100, 100), rl.Color.white); -- cgit v1.3.1