Hypfer / lovelace-valetudo-map-card

Display the map from a valetudo-enabled robot in a home assistant dashboard card.
MIT License
256 stars 36 forks source link

rotate breaks crop #147

Open xuefer opened 1 year ago

xuefer commented 1 year ago

image step 1: "top 100px of image" is cropped before rotate, which is good. step 2: image is rotated 270 step 3: everything is move up 100px, which is unexpected. expected: move left, because top is now left after rotate 270

it seems the coordinate is the center of the map, so i'd suggest the code to use center point coordinate system. for robots returning map that does not assume center point as (0,0), calculate the new center point, map all pixel/points to new coordinate, so every use can assume center pointer of the map is (0,0)

cryptogeek13 commented 1 year ago

same problem for left_padding, should I create a separate issue for that? nvm, it's a different issue