Implement support for drawing any SVG file to map

This commit is contained in:
XANTRONIX 2025-03-24 22:34:55 -04:00
parent 130cffaa26
commit 3ca6078cd1

View file

@ -29,14 +29,20 @@ class EquirectMap():
self.map_width = bounds[1] - bounds[3]
self.map_height = bounds[0] - bounds[2]
def draw_from_file(self, cr: cairo.Context, path: str):
def draw_from_file(self,
cr: cairo.Context,
path: str,
x: float,
y: float,
width: float,
height: float):
svg = Rsvg.Handle.new_from_file(path)
rect = Rsvg.Rectangle()
rect.x = 0
rect.y = 0
rect.width = self.width
rect.height = self.height
rect.x = x
rect.y = y
rect.width = width
rect.height = height
svg.render_layer(cr, None, rect)