From e0577d6bc840d0e8f6f9d3cb20c2a93112b1c950 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 21 Feb 2015 02:06:20 +0100 Subject: Fixes bug 1152657: "Paste selection with original+clone(s): Wrong placement between original and clones" Fixed bugs: - https://launchpad.net/bugs/1152657 (bzr r13932) --- src/ui/clipboard.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/ui/clipboard.cpp') diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 94a1eb2dc..5802a1be3 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -685,10 +685,18 @@ void ClipboardManagerImpl::_copySelection(Inkscape::Selection *selection) sp_repr_css_set(obj_copy, css, "style"); sp_repr_css_attr_unref(css); + Geom::Affine transform=item->i2doc_affine(); + // 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) - gchar *transform_str = sp_svg_transform_write(item->i2doc_affine()); + SPUse *use=dynamic_cast(item); + if( use && selection->includes(use->get_original()) ){//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); } -- cgit v1.2.3