summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2018-09-10 15:57:11 +0000
committerMartin Owens <doctormo@gmail.com>2018-09-10 15:57:11 +0000
commit88d8b781054039704afb495845c536d389afb3cb (patch)
tree228a8075a36d520f92b491e95d2f0f0a5623733b /src/ui
parentFix bug #167900 (diff)
parentCMake: Install extensions after switch to submodule (diff)
downloadinkscape-88d8b781054039704afb495845c536d389afb3cb.tar.gz
inkscape-88d8b781054039704afb495845c536d389afb3cb.zip
Merge branch 'master' of gitlab.com:inkscape/inkscape into yhoshi/inkscape-bug167900
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/clipboard.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 2f0cc2bbb..65a704278 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -760,15 +760,17 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection)
// write the complete accumulated transform passed to us
// (we're dealing with unattached representations, so we write to their attributes
// instead of using sp_item_set_transform)
+
SPUse *use=dynamic_cast<SPUse *>(item);
- if( use && use->get_original() && use->get_original()->parent ){//we are copying something whose parent is also copied (!)
- transform = ((SPItem*)(use->get_original()->parent))->i2doc_affine().inverse() * transform;
- }
- gchar *transform_str = sp_svg_transform_write(transform );
-
-
- obj_copy->setAttribute("transform", transform_str);
- g_free(transform_str);
+ if( use && use->get_original() && use->get_original()->parent) {
+ if (selection->includes(use->get_original())){ //we are copying something whose parent is also copied (!)
+ obj_copy->setAttribute("transform", sp_svg_transform_write( ((SPItem*)(use->get_original()->parent))->i2doc_affine().inverse() * transform));
+ } else { // original is not copied
+ obj_copy->setAttribute("transform-with-parent", sp_svg_transform_write(transform));
+ obj_copy->setAttribute("transform", sp_svg_transform_write( ((SPItem*)(use->get_original()->parent))->i2doc_affine().inverse() * transform));
+ }
+ } else
+ obj_copy->setAttribute("transform", sp_svg_transform_write(transform));
}
}