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

Minimap: SVG elements are incorrectly drawn #31

Open
bramus opened this issue Sep 14, 2023 · 1 comment
Open

Minimap: SVG elements are incorrectly drawn #31

bramus opened this issue Sep 14, 2023 · 1 comment
Labels
bug Something isn't working P2 P2 – Want

Comments

@bramus
Copy link
Owner

bramus commented Sep 14, 2023

E.g. https://cdpn.io/pen/debug/bGORQMM/d1616ec346e06f09d7f34ec667571e2e (forked from https://codepen.io/raphaelgoetter/pen/wvReGKK by @raphaelgoetter to preserve a copy)

The inspected elements don’t have the correct size because SVGElement doesn't have offsetWidth/offsetHeight properties, unlike `HTMLElement.

@bramus bramus added bug Something isn't working P0 P0 – Emergency P1 P1 – Need and removed P0 P0 – Emergency labels Sep 14, 2023
@bramus
Copy link
Owner Author

bramus commented Sep 14, 2023

Some quick checking tells me this is gonna be a tough one:

  • Getting the bounding ClientRect is influenced by transforms, so that’s a no go.
    • When getting the untransformed box it doesn’t produce entirely correct numbers
    • Furthermore that linked to function falls back to offsetWidth and offsetHeight, which returns undefined.
  • Getting the box using $0.getBBox() does not seem to produce the correct numbers. They are off by a few pixels when compared to the size Chrome reports. Maybe that could just work though, as they are verrrry close and at least have the correct aspect-ratio.
    • Chrome seems to show the values as reported by $0.getClientRects()[0]

@bramus bramus added P2 P2 – Want and removed P1 P1 – Need labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 P2 – Want
Projects
None yet
Development

No branches or pull requests

1 participant