Shared-Reality-Lab / IMAGE-server

IMAGE project server components
Other
2 stars 7 forks source link

Shift origin of output svg in map and photo tactile handlers to (0,0) #916

Closed VenissaCarolQuadros closed 1 week ago

VenissaCarolQuadros commented 1 week ago

The TAT canvas does not shift if the SVG origin is anything besides (0,0) despite fitting to graphic height and width but the SVG output of earlier implementations of the photo/map-tactile-handler had origins at (0, -y_max). While the ideal solution would be to make the fixes to the TAT, this requires more extensive changes and potentially fixing issues that changes to SVG-Edit will fix (tracked on Shared-Reality-Lab/IMAGE-Monarch#60). Instead, the origin of the photo and map-tactile-svg-handlers have been modified to output SVGs with viewBox = "0 0 width height"

Tested for

  1. Three cows image The SVGs appear identical visually but the viewBox is different Old:

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
     width="1632" height="1224" viewBox="0 -1224 1632 1224">

    New:

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
     width="1632" height="1224" viewBox="0 0 1632 1224">
    ..
  2. "coordinates": {
        "latitude": 45.54646,
        "longitude": -73.49546
    }

    Old:

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
     width="700" height="700" viewBox="0 -700 700 700">

New:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
     width="700" height="700" viewBox="0 0 700 700">

Jaydeep also verified that this works as expected while integrating the TAT with the extension

Required Information

Coding/Commit Requirements

New Component Checklist (mandatory for new microservices)

OR