summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 844f18b)
raw | patch | inline | side by side (parent: 844f18b)
author | speleo3 <speleo3@users.sourceforge.net> | |
Wed, 13 May 2009 17:41:26 +0000 (17:41 +0000) | ||
committer | speleo3 <speleo3@users.sourceforge.net> | |
Wed, 13 May 2009 17:41:26 +0000 (17:41 +0000) |
src/file.cpp | patch | blob | history | |
src/ui/clipboard.cpp | patch | blob | history |
diff --git a/src/file.cpp b/src/file.cpp
index f8d631455fd48d36e499e6748920f2a3ca550623..80b424f5d698bf2051dd1a1abb7595ddddf28aa7 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
Inkscape::Selection *selection = sp_desktop_selection(desktop);
selection->set(SP_ITEM(new_obj));
+ // preserve parent and viewBox transformations
+ // c2p is identity matrix at this point unless sp_document_ensure_up_to_date is called
+ sp_document_ensure_up_to_date(doc);
+ Geom::Matrix affine = SP_ROOT(SP_DOCUMENT_ROOT(doc))->c2p * sp_item_i2doc_affine(SP_ITEM(place_to_insert)).inverse();
+ sp_selection_apply_affine(selection, desktop->dt2doc() * affine * desktop->doc2dt(), true, false);
+
// To move the imported object, we must temporarily set the "transform pattern with
// object" option.
{
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 2ee62cfec39df94c6df303362da11d8d41ada54e..7e41006bec7832908135b1423526b39a18d97e12 100644 (file)
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
// invers apply parent transform
Geom::Matrix doc2parent = sp_item_i2doc_affine(SP_ITEM(desktop->currentLayer())).inverse();
- sp_selection_apply_affine(selection, doc2parent);
+ sp_selection_apply_affine(selection, desktop->dt2doc() * doc2parent * desktop->doc2dt(), true, false);
// Update (among other things) all curves in paths, for bounds() to work
sp_document_ensure_up_to_date(target_document);