Fix screen_to_map() (I think)

This commit is contained in:
XANTRONIX 2025-03-25 12:37:15 -04:00
parent 3ca6078cd1
commit efcf426b77

View file

@ -47,8 +47,8 @@ class EquirectMap():
svg.render_layer(cr, None, rect) svg.render_layer(cr, None, rect)
def screen_to_map(self, x: float, y: float) -> shapely.Point: def screen_to_map(self, x: float, y: float) -> shapely.Point:
lon = self.bounds[3] + (x / self.width) * self.width lon = (x / self.width) * self.map_width + self.bounds[3]
lat = self.bounds[0] + (y / self.height) * self.height lat = self.height * self.map_height + self.bounds[2] + (y / self.height)
return shapely.Point(lon, lat) return shapely.Point(lon, lat)