UPDATE: Window resizable

This commit is contained in:
2025-03-16 17:15:27 +01:00
parent a38b2de19b
commit 9cd205a293
3 changed files with 6 additions and 1 deletions

View File

@@ -14,6 +14,10 @@ class MapCoordController:
self.map_width = map_max_x - map_min_x
self.map_height = map_max_y - map_min_y
def update_screen_size(self, screen_width: int, screen_height: int):
self.screen_width = screen_width
self.screen_height = screen_height
def screen_to_map(self, x, y):
mapped_x = mapped_value(x, 0, self.screen_width, self.map_min_x, self.map_max_x)
mapped_y = mapped_value(y, 0, self.screen_height, self.map_min_y, self.map_max_y)