From efcf426b77743c45b37813cb9e2b596a3c69fd3a Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Tue, 25 Mar 2025 12:37:15 -0400 Subject: [PATCH] Fix screen_to_map() (I think) --- lib/xmet/map.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xmet/map.py b/lib/xmet/map.py index daec184..4afe4ed 100644 --- a/lib/xmet/map.py +++ b/lib/xmet/map.py @@ -47,8 +47,8 @@ class EquirectMap(): svg.render_layer(cr, None, rect) def screen_to_map(self, x: float, y: float) -> shapely.Point: - lon = self.bounds[3] + (x / self.width) * self.width - lat = self.bounds[0] + (y / self.height) * self.height + lon = (x / self.width) * self.map_width + self.bounds[3] + lat = self.height * self.map_height + self.bounds[2] + (y / self.height) return shapely.Point(lon, lat)