GNOME Bugzilla – Bug 475978
pydia svg export : truncated output (viewBox should be ints)
Last modified: 2011-01-30 19:41:48 UTC
Please describe the problem: When I export a drawing to svg format, it is not well viewed in other SVG tools. For example Firefox and Sketsa Editor. It seems that the exported region is truncated or that the bounding box is not well centered. I expect the output to have identical margins (top,bottom,left and right). The size of the margins depends on the content. Steps to reproduce: 1. Draw a box. Export to svg. 2. Draw a 2nd box next to the first one. Export to svg. 3. Draw a 3rd box next to the former ones. Export to svg. Compare export files. Actual results: Depending on boxes positioning, the size of margins when viewed with Firefox or Sketsa are variables whereas position of box is the same in editor. It looks like the bounding box of the exported portion of diagram is wrong. Expected results: I expect the bounding box of the export diagram to be centered. Does this happen every time? Yes Other information:
Confirmed, attaching example diagram and SVG output that show a BB in Inkscape that has nothing to do with the page layout or anything.
Created attachment 95402 [details] Simple diagram that shows bug when exported
Created attachment 95403 [details] SVG file exported using SVN head
Please be aware that there are up to three ways to export SVG, see: http://mail.gnome.org/archives/dia-list/2007-September/msg00023.html This bug report reminds me on the main issue in bug #316590, but here diasvg.py is used. The issue is related to the svg::viewBox apparently only allowing int rather than float but I'd like to find if there is a different solution than taken in DiaSvgRenderer.
more descriptive subject
*** Bug 540220 has been marked as a duplicate of this bug. ***
After all it where not the ints but passing in conrners instead of upper left corner, width and height. Finally fixed on master: http://git.gnome.org/browse/dia/commit/?id=e6397b3b740081a91ebd6f6b6fc717eda8d79d63