Hello
After a brief discussion on the list I did a small research for the Transformation Anchors idea. So, I 'd like to ask about the validity of the things I found.
* SVG 1.1 has a "transform" attribute which is used for some of the transformations.
Inkscape stores the transformation in the file as following: * "move", "scale" doesn't apply a trans matrix but simply moves, scales the coordinates. It also adds a second inkscape:perspective element. This one include a property "persp3d". This is related to the src/persp3d.cpp and the Persp3D class. * "rotate", "skew" applies a transformation matrix with the SVG:transform attribute. * "matrix" depends on the matrix's values. It could lead to one of the above situations.
The Transformation UI is implemented in ui/dialogs/transformations.cpp * sp_desktop_selection() is used in order to get the things the user has selected from the "drawing area". (I don't know if you have a specific name for the area on which the inkscape user draws and selects graphics from. I called it "drawing area"). * The functions Transformation::applyPage(Move|Rotate|Scale|...) are responsible for the transformation of the selection.
I then tried to figure out how "move" transformation works: updatePageMove() takes the bounding box from the selection. This is a NR::Rect object (NR::Maybe template). NR stands for "new renderer" right? I follow up to here but then I get a bit confused in this line: double x = bbox->min()[NR::X]; NR::Rect::min() returns a member of the NR::Rect class. It returns a Point instance. This class has overloaded the [] operators. With this overloading we return the [i]-th element of a Coord member. And this Coord is an array with 2 elements (for x and y). I think I think I lost the logic of it a bit...
Then we take the value which updatePageMove() had set and we apply it with applyPageMove(). This calls sp_selection_move_relative() and then sp_selection_apply_affine(). That's as far as I have seen.
So, it boils down to pass sp_selection_apply_affine() an argument about the center of the tranformation and change things in there so that the argument is used correctly?
Sorry for the lengthy mail. I just want to make sure that I get how things work in order to estimate the size of the project and the extend of changes in the base code.
Regards Vangelis Katsikaros
__________________________________________________ ×ñçóéìïðïéåßôå Yahoo!; ÂáñåèÞêáôå ôá åíï÷ëçôéêÜ ìçíýìáôá (spam); Ôï Yahoo! Mail äéáèÝôåé ôçí êáëýôåñç äõíáôÞ ðñïóôáóßá êáôÜ ôùí åíï÷ëçôéêþí ìçíõìÜôùí http://mail.yahoo.gr