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

fix: viewBox attr when using pixel units #50

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

patrislav1
Copy link
Collaborator

fixes SVG output for tools that rely on viewBox, such as asciidoctor

fixes #49

From SVG documentation it appears that viewBox only supports pixel units, so I just add it when we use pixels

fixes SVG output for tools that rely on viewBox, such as asciidoctor
@wader
Copy link
Owner

wader commented Apr 10, 2024

Played around with viewBox and read the spec a bit but not sure i got much wiser :) reading https://www.w3.org/TR/SVG11/coords.html#Introduction it sounds like it might be possible to use something else then px but i can't get it to work, also says "The supported length unit identifiers are: em, ex, px, pt, pc, cm, mm, in, and percentages." 😬

Anyways, change looks good and we can improve on non-pixels if possible later

@wader wader merged commit fb12969 into wader:master Apr 10, 2024
1 check passed
@patrislav1
Copy link
Collaborator Author

Played around with viewBox and read the spec a bit but not sure i got much wiser :) reading https://www.w3.org/TR/SVG11/coords.html#Introduction it sounds like it might be possible to use something else then px but i can't get it to work, also says "The supported length unit identifiers are: em, ex, px, pt, pc, cm, mm, in, and percentages." 😬

I'm not entirely sure about the relation between viewport and viewbox but IIUC then the latter maps the former to some kind of display region which can only be given in pixels. (The spec looks kind of vague in this regard, and how it's implemented by renderers is another question 🤯 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use viewBox instead of width and height
2 participants