Closed GoogleCodeExporter closed 9 years ago
Hi. Thanks for the report.
Can you attach the SVG please? I can't tell, without looking at the SVG
itself, whether it is being rendered correctly or not.
Original comment by paul.leb...@gmail.com
on 10 Mar 2014 at 9:30
I've attached the svg, the source is
http://upload.wikimedia.org/wikipedia/commons/7/7e/Sphere_-_monochrome_simple.sv
g
Original comment by waack.ma...@gmail.com
on 10 Mar 2014 at 9:51
Hi. This doesn't look like a bug to me. The library seems to be doing the
right thing. I'll explain.
The SVG defines a 500x500 diagram. The sphere is 400x410 (slightly squashed
horizontally) and almost - but not quite - centred in the diagram.
Because the SVG has no viewBox attribute, no scaling will happen. The sphere
will be drawn at full size. So with your picture being only 200x200, you will
only get the top left portion of it. As you are seeing.
To achieve the effect you want, the simplest solution is to add a viewBox to
the SVG. In the case of this file, the sphere occupies the area of the diagram
from (50,50) to (450,460). So your viewBox should be "50 50 400 410" (that's
x,y,width,height).
I will attach a modified SVG file with this change. Try it. I believe this
file should display as you originally intended. Let me know if it doesn't.
Marking bug report as Invalid (not a bug).
Original comment by paul.leb...@gmail.com
on 10 Mar 2014 at 10:24
Slight correction. I forgot to say you also have to set the width and height
attributes to "100%".
In addition, if you want the slight suqash to be corrected for, you will have
to add the following to the file:
preserveAspectRatio="none"
Updated file attached.
Original comment by paul.leb...@gmail.com
on 10 Mar 2014 at 10:32
Attachments:
Thanks for the file and the explanation, it displays as intended. Do not know
much about svg, thought I can just use it, looks like I have to learn more
about it...
Original comment by waack.ma...@gmail.com
on 10 Mar 2014 at 10:52
I'm glad it worked. Thanks for letting me know. Good luck with your project!
Original comment by paul.leb...@gmail.com
on 10 Mar 2014 at 10:57
Original issue reported on code.google.com by
waack.ma...@gmail.com
on 10 Mar 2014 at 8:14Attachments: