summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorThomas Holder <speleo3@users.sourceforge.net>2009-05-13 17:41:26 +0000
committerspeleo3 <speleo3@users.sourceforge.net>2009-05-13 17:41:26 +0000
commite4355ae59e9e19e9b55c736cb53c0cf6d5709091 (patch)
tree68e38e18ade64ada53cf16b054071d6e0523fc97 /src/file.cpp
parentnew "compensate" param for sp_selection_apply_affine and sp_selection_move_re... (diff)
downloadinkscape-e4355ae59e9e19e9b55c736cb53c0cf6d5709091.tar.gz
inkscape-e4355ae59e9e19e9b55c736cb53c0cf6d5709091.zip
parent transformation on import and paste (Bug #376064, Bug #375499)
(bzr r7876)
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/file.cpp b/src/file.cpp
index f8d631455..80b424f5d 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -1011,6 +1011,12 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri,
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.
{