summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.zig6
1 files 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);