client.py icon indicating copy to clipboard operation
client.py copied to clipboard

Align viewbox center with vacuum map center

Open philek opened this issue 1 year ago • 9 comments

This is an alternative approach for supporting the Vacuum Map card calibration from https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/issues/321. This will make the calibration much simpler. Object coordinates inside the SVG are vacuum coordinates divided by 50 with y axis flipped. That information, combined with the viewbox, will be enough to translate the vacuum coordinates to a position on even a scaled image on the frontend.

This has the benefit over my previous PR of not changing the interface. The calibration points can be static and added outside of this library.

Summary by CodeRabbit

  • Refactor

    • Improved map manipulation logic for better performance and maintainability.
  • Tests

    • Updated test cases to align with refactored map manipulation functions.

philek avatar Feb 21 '24 21:02 philek