diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-03-28 04:21:00 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-03-28 04:21:00 +0000 |
| commit | cf2bbea836baddbdd292a270d2687657dc652e9f (patch) | |
| tree | b436abce43468eb3df4bb91f506f9861194dd784 /src | |
| parent | copy rotation center when converting to path (diff) | |
| download | inkscape-cf2bbea836baddbdd292a270d2687657dc652e9f.tar.gz inkscape-cf2bbea836baddbdd292a270d2687657dc652e9f.zip | |
preserve (but not use yet) rotation center when making tiled clones
(bzr r315)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dialogs/clonetiler.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index b33d8b0f3..196bf7e86 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -30,6 +30,7 @@ #include "../interface.h" #include "../selection.h" #include "../style.h" +#include "../desktop.h" #include "../desktop-handles.h" #include "../sp-namedview.h" #include "../document.h" @@ -1246,6 +1247,13 @@ clonetiler_apply (GtkWidget *widget, void *) clone->setAttribute("inkscape:tiled-clone-of", id_href); clone->setAttribute("xlink:href", id_href); + NR::Point new_center; + bool center_set = false; + if (obj_repr->attribute("inkscape:transform-center-x") || obj_repr->attribute("inkscape:transform-center-y")) { + new_center = desktop->dt2doc(SP_ITEM(obj)->getCenter()) * t; + center_set = true; + } + gchar affinestr[80]; if (sp_svg_transform_write(affinestr, 79, t)) { clone->setAttribute("transform", affinestr); @@ -1264,6 +1272,16 @@ clonetiler_apply (GtkWidget *widget, void *) // add the new clone to the top of the original's parent SP_OBJECT_REPR(parent)->appendChild(clone); + + if (center_set) { + SPObject *clone_object = SP_DT_DOCUMENT(desktop)->getObjectByRepr(clone); + if (clone_object && SP_IS_ITEM(clone_object)) { + clone_object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + SP_ITEM(clone_object)->setCenter(desktop->doc2dt(new_center)); + clone_object->updateRepr(); + } + } + Inkscape::GC::release(clone); } cur[NR::Y] = 0; |
