-
Notifications
You must be signed in to change notification settings - Fork 27
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
svg is drawn smaller than actual size #39
Comments
Figured out having viewbox parameter in tag makes size problem. |
this is huge - even if the artwork is 120x120, the artboard is 120x120, everything is 120x120 - the image drawn in flash might still end up being scaled wrong. removing that viewbox attr fixes it. this is still very much a big bug. |
I am comparing the library result with chrome. But if I change svg width and height to pt, in, cm, or any unit that must be converted using dpi, there is a slight size difference between the AS3SVGRenderer and chrome. That conversion is coded on method getUserUnit, at this file: You can see that the conversion from "in" to "pixels" (user unit) is a multiplication by "90", that, means that this library considers 90 dpi (dots per inch). Which is the same of Inkscape. But each renderer choose a different DPI to render, maybe that's the difference that you are seeing. Take a look at those links: Can any of you confirm that this is what is causing the difference on size? If that isn't the problem, can you provide me an svg to reproduce the problem? About the differences between old version of AS3SVGRenderer and the current version, I believe the version you were using don't support ViewBox and ViewPort correctly, so it don't re-scale the svg. |
github won't let me attach svgs, so here are a couple links - http://junk.mattlohkamp.com/2in1.svg not sure what version of the library this was using, I wanna say I grabbed it a couple months ago? it was happening intermittently too, which was one of the weirdest parts - sometimes they'd scale correctly, sometimes they wouldn't. sorry, I know this isn't much help. :[ I'll see if I can dig up the old build of my project that was showing the issue. |
SVG object is drawn about 25% smaller than the actual size.
see this photo please: http://imageshack.com/a/img203/5676/gqrf.jpg
The first line in the photo is drawn by my own SVG parser.
The second line is drawn by AS3SVGRenderer.
Both parsers used to draw in the same size but this problem happened after I updated AS3SVGRenderer from one-year old version to the newest version.
All I wrote is
var svg:SVG = new SVG() //Flex.SVG
svg.source = getSVGText();
Is there anything I am missing?
The text was updated successfully, but these errors were encountered: