From 9e1168170eb7f36b186c1d7c524a6cb0868906e3 Mon Sep 17 00:00:00 2001 From: Filip Rutkowski Date: Mon, 22 Jan 2024 15:53:31 +0100 Subject: [PATCH] Set image size --- deebot_client/map.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deebot_client/map.py b/deebot_client/map.py index 1469637b..f08728d5 100644 --- a/deebot_client/map.py +++ b/deebot_client/map.py @@ -616,9 +616,6 @@ def get_calibrated_map(self) -> CalibratedMap | None: self._last_image = None return None - # Build the SVG elements - svg_map = svg.SVG() - svg_map.elements = [_SVG_DEFS] manipulation = MapManipulation( AxisManipulation( map_shift=background.bounding_box[0], @@ -631,6 +628,10 @@ def get_calibrated_map(self) -> CalibratedMap | None: ), ) + # Build the SVG elements + svg_map = svg.SVG(width=manipulation.x.svg_max, height=manipulation.y.svg_max) + svg_map.elements = [_SVG_DEFS] + # Set map viewBox based on background map bounding box. svg_map.viewBox = svg.ViewBoxSpec( 0,