Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

VenissaCarolQuadros
Copy link
Member

@VenissaCarolQuadros VenissaCarolQuadros commented Nov 15, 2024

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">
..
"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

  • I referenced the issue addressed in this PR.
  • I described the changes made and how these address the issue.
  • I described how I tested these changes.

Coding/Commit Requirements

  • I followed applicable coding standards where appropriate (e.g., PEP8)
  • I have not committed any models or other large files.

New Component Checklist (mandatory for new microservices)

  • I added an entry to docker-compose.yml and build.yml.
  • I created A CI workflow under .github/workflows.
  • I have created a README.md file that describes what the component does and what it depends on (other microservices, ML models, etc.).

OR

  • I have not added a new component in this PR.

@JRegimbal JRegimbal merged commit 1db1d57 into main Nov 18, 2024
4 checks passed
@JRegimbal JRegimbal deleted the modify-svg-origin branch November 18, 2024 16:02
@jeffbl jeffbl added the deploy! deploy into production from test! label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! deploy into production from test!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants