svg - How to calculate the y coordinate of a rectangle without transforms in Inkscape? -
imagine have inkscape file following rectangle:
i want calculate y coordinate reported inkscape (596.654
).
how can (manually) ?
i tried this:
- the top of page seems have y coordinate of 744.
- i subtract number y coordinate of rectangle in xml editor (
417
) , height (37
) ,744 - 417 - 37 = 290
.
note rectangle doesn't have transforms , doesn't belong group.
here's simplified version of svg relevant information included:
<svg width="297mm" height="210mm" viewbox="0 0 1052.3622 744.09448"> <g transform="translate(0,-308.26772)"> <rect x="216.1537" y="417.34927" width="385.25827" height="37.859257" style="stroke-width:1;" /> </g> </svg>
despite thought, there is transform in there (in group).
svg internal coordinates have origin in top left. whereas inkscape displays converted value relative more normal origin @ bottom left. displayed value takes account stroke width.
your rectangle drawn (internal coords) at
y = recty + translatey = 417.34927 - 308.26772 = 109.08155
the page has height of 744.09448. displayed ccoordinate be:
y = pageheight - recty - recth - strokewidth/2 = 744.09448 - 109.08155 - 37.859257 - 0.5 = 596.653673
Comments
Post a Comment