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

Scale the icons when viewBox and width/height differs #9

Open
nfroidure opened this issue Mar 8, 2014 · 5 comments
Open

Scale the icons when viewBox and width/height differs #9

nfroidure opened this issue Mar 8, 2014 · 5 comments

Comments

@nfroidure
Copy link
Owner

The process should be:

  • set the viewbox size with the viewBox attribute if it exists then, read x y width and height attributes to scale the icon to the desired width/height being preserveAspectRatio aware
  • otherwise, use x y width and height attributes
  • finally if none of this attributes are present, maybe deduct from the drawed elements the icon bounds ?

Specs:
http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute
http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute

@dongyuwei
Copy link

+1

@nfroidure
Copy link
Owner Author

Done 44e3dd6

@nfroidure nfroidure marked this as a duplicate of #73 Jul 15, 2017
@aseem2625
Copy link

Hey @nfroidure this actually didn't solve the issue..
Some other guy also faced this issue with latest version.

@seanking2919
Copy link

Fantasticon has faced similar issues regarding fonts not being vertically centered properly in some cases.

@nfroidure
Copy link
Owner Author

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

No branches or pull requests

4 participants