I have an SVG file with objects that have a translate(). I would like to rotate these objects but a combination of translate() and rotate() is not succesful. When I reverse engineer what Inkscape is doing, I see after rotation, around the objects center, a matrix() replace the translate(). The contraints on the 6 parameters I understand but am unable to reproducte these in correctly altering the SVG. Below are two examples of 45 degree rotations in both directions.
"node19" before rotation:
Code: Select all
<g
class="node"
id="node19"
transform="translate(4,321.187)">
<title
id="title129">qwertyasdf22</title>
<ellipse
style="fill:none;stroke:#000000"
sodipodi:ry="18.3848"
sodipodi:rx="79.195999"
sodipodi:cy="-260.41699"
sodipodi:cx="117.27"
d="m 196.466,-260.41699 c 0,10.15364 -35.45726,18.3848 -79.196,18.3848 -43.738746,0 -79.196003,-8.23116 -79.196003,-18.3848 0,-10.15365 35.457257,-18.3848 79.196003,-18.3848 43.73874,0 79.196,8.23115 79.196,18.3848 z"
id="ellipse131"
ry="18.3848"
rx="79.195999"
cy="-260.41699"
cx="117.27" />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times Roman,serif'"
id="text133"
font-size="14.00"
y="-256.81699"
x="117.27">qwertyasdf22</text>
</g>
"node19" after rotation:
Code: Select all
<g
class="node"
id="node19"
transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,222.49021,327.83504)">
<title
id="title129">qwertyasdf22</title>
<ellipse
style="fill:none;stroke:#000000"
sodipodi:ry="18.3848"
sodipodi:rx="79.195999"
sodipodi:cy="-260.41699"
sodipodi:cx="117.27"
d="m 196.466,-260.41699 c 0,10.15364 -35.45726,18.3848 -79.196,18.3848 -43.738746,0 -79.196003,-8.23116 -79.196003,-18.3848 0,-10.15365 35.457257,-18.3848 79.196003,-18.3848 43.73874,0 79.196,8.23115 79.196,18.3848 z"
id="ellipse131"
ry="18.3848"
rx="79.195999"
cy="-260.41699"
cx="117.27" />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times Roman,serif'"
id="text133"
font-size="14.00"
y="-256.81699"
x="117.27">qwertyasdf22</text>
</g>
"node33" before rotation:
Code: Select all
<g
class="node"
id="node33"
transform="translate(4,321.187)">
<title
id="title227">qwertyasdf43</title>
<ellipse
style="fill:none;stroke:#000000"
sodipodi:ry="18.3848"
sodipodi:rx="79.195999"
sodipodi:cy="-121.323"
sodipodi:cx="358.18701"
d="m 437.38301,-121.323 c 0,10.15365 -35.45726,18.3848 -79.196,18.3848 -43.73874,0 -79.196,-8.23115 -79.196,-18.3848 0,-10.15364 35.45726,-18.3848 79.196,-18.3848 43.73874,0 79.196,8.23116 79.196,18.3848 z"
id="ellipse229"
ry="18.3848"
rx="79.195999"
cy="-121.323"
cx="358.18701" />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times Roman,serif'"
id="text231"
font-size="14.00"
y="-117.723"
x="358.18701">qwertyasdf43</text>
</g>
"node33" after rotation
Code: Select all
<g
class="node"
id="node33"
transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,23.122232,32.375852)">
<title
id="title227">qwertyasdf43</title>
<ellipse
style="fill:none;stroke:#000000"
sodipodi:ry="18.3848"
sodipodi:rx="79.195999"
sodipodi:cy="-121.323"
sodipodi:cx="358.18701"
d="m 437.38301,-121.323 c 0,10.15365 -35.45726,18.3848 -79.196,18.3848 -43.73874,0 -79.196,-8.23115 -79.196,-18.3848 0,-10.15364 35.45726,-18.3848 79.196,-18.3848 43.73874,0 79.196,8.23116 79.196,18.3848 z"
id="ellipse229"
ry="18.3848"
rx="79.195999"
cy="-121.323"
cx="358.18701" />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times Roman,serif'"
id="text231"
font-size="14.00"
y="-117.723"
x="358.18701">qwertyasdf43</text>
</g>
As one can see the translate is identical to both nodes. How do I calculate the 'e' and 'f' parameters of both matrix() transformations. How do I use cy and cx for that? Since I assume I need to use these values somehow.
Thanks for your help,
Pander