From e4355ae59e9e19e9b55c736cb53c0cf6d5709091 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Wed, 13 May 2009 17:41:26 +0000 Subject: parent transformation on import and paste (Bug #376064, Bug #375499) (bzr r7876) --- src/file.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/file.cpp') 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. { -- cgit v1.2.3