Re: [Inkscape-devel] new svgslice release
On 4/23/05, Lee Braiden <lee.b@...786...> wrote:
On Saturday 23 Apr 2005 13:49, bulia byak wrote:
On 4/23/05, Lee Braiden <lee.b@...786...> wrote:
I have a rectangle stretching across the width of the canvas. In the toolbar, it says this rect is 769px by 240px. But in the saved SVG, the width says 615 by 183. I would have expected this to be the same, if it's also in px. Maybe I'm misunderstanding something?
The parent <g> of the rect has transform= attribute which stretches it, hence the discrepancy. Generally, in SVG you cannot rely just on the attributes of the element itself; you need to take into account the transforms of all its ancestors because they all affect that element. That's why extracting dimensions from SVG is a nontrivial task, and that's why I added the --query command line options to make this accessible for script/extension writers. If you query that rect by Inkscape you get the correct width:
$ inkscape layer_demo.svg --query-width --query-id ONEandTWO 769.54902
i.e. the same as it has when rendered on screen.
participants (1)
-
bulia byak