Bug in Extracting Objects By ID? -- OOPS
SORRY. I accidentally hit the SEND button. Here is the email I was trying to write
I am very new to both Inkscape and SVG, but I think I have found a little bug. I would be happy to get the source and try to fix it, but I would like confirmation that it is, indeed a bug. I am trying to extract objects by ID into plain SVG files with the command-line interface. For example:
inkscape -z -i blue -j -l blue.svg drawing.sv
This extracts the object, all right, but it doesn't appear in the right place, so that the icon is blank. For example, drawing.svg has a blue rectange (ID blue) whose dimensions are shown in the UI as height 150, width 200, x=100, y=625. The height of the document is 1052.36220 (A4 at 90 dpi.) When I look at drawing.svg in a text editor, there's a little rounding: width="199.01431" height="149.01431" x="100.49285" y="277.85504"
The difference in the y-coordinate comes because Inkscape's UI places the origin of both the viewport and the object at the bottom left instead of the upper left, so to get the y-coordinate for SVG we subtract both the "UI coordinate" and the rectangle height from the viewport height.
Now, when I look at blue.svg in the UI the x-coordinate of the rectangle is 0 but the y-coordinate is not. The SVG shows
transform="translate(-100.00001,-625.00001)
That is, the UI coord is used, not the SVG coord. If I change the y-coord in the UI to 0, then the SVG file shows
transform="translate(-100.00001,-277.36222)
and the icon appears as one would expect.
It seems clear to me that this is a bug, since the blue.svg file says,
viewBox="0 0 199.99999 149.99999"
As I said earlier, I'm so new to this that I would like someone to confirm that this is a bug before I go and fix it.
participants (1)
-
Saul Spatz