changeset 599:03c0f1f5488c

Use integer division when calculating tile position.
author Simon Cross <hodgestar@gmail.com>
date Sat, 14 Jan 2023 19:33:30 +0100
parents 0a2cc2ee16c2
children 93cb9c1d2bb2
files mamba/widgets/level.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mamba/widgets/level.py	Sat Jan 14 19:04:47 2023 +0100
+++ b/mamba/widgets/level.py	Sat Jan 14 19:33:30 2023 +0100
@@ -125,7 +125,7 @@
             self.drawing = False
 
     def convert_pos(self, pos):
-        return (pos[0] / TILE_SIZE[0], pos[1] / TILE_SIZE[1])
+        return (pos[0] // TILE_SIZE[0], pos[1] // TILE_SIZE[1])
 
     def update_tile(self, tile_pos):
         """Update the tile at the current mouse position"""