roxrook / svg-android

Automatically exported from code.google.com/p/svg-android
0 stars 0 forks source link

TIP: check your SVG header! #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Not much of a problem concerning svg-android code but I do want to warn you as 
I have been coding a workaround for 2 hours to solve this problem only to find 
out just then that the problem was inside my SVG header.

My SVG showed up a lot smaller than it should and also on a weird position, 
even though the SVG had a bounds layer which was parsed correctly by 
svg-android. Turns out the SVG header had wrong height and width values (higher 
than my bounds values) in it, causing the main content to scale down to fit the 
whole thing. The artwork was exported to SVG 1.1 using Illustrator CS5.1

Anyway, just make sure the header width and height values match your bounds 
layer rect width and height values and you'll be fine.

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" 
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     width="154px" height="61px" viewBox="0 0 595.28 841.89" enable-background="new 0 0 595.28 841.89" xml:space="preserve">
<g id="bounds">
    <rect fill="#FFC91F" width="154" height="61"/>
</g>

Original issue reported on code.google.com by dvange...@gmail.com on 18 Nov 2011 at 12:03