diff options
| author | John Bintz <me@johnbintz.com> | 2007-02-28 03:14:00 +0000 |
|---|---|---|
| committer | johncoswell <johncoswell@users.sourceforge.net> | 2007-02-28 03:14:00 +0000 |
| commit | 438c107ed7d75f02e2654784d4d24028c65a0e44 (patch) | |
| tree | da921fa0ff37e9d1988325a95aa3638f565255d2 /src/flood-context.cpp | |
| parent | Fix issue with adding traced path to a layer with a transform (diff) | |
| download | inkscape-438c107ed7d75f02e2654784d4d24028c65a0e44.tar.gz inkscape-438c107ed7d75f02e2654784d4d24028c65a0e44.zip | |
Fix layer transform issue
(bzr r2465)
Diffstat (limited to 'src/flood-context.cpp')
| -rw-r--r-- | src/flood-context.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/flood-context.cpp b/src/flood-context.cpp index 467d47de7..896d4d29f 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -332,28 +332,29 @@ static void do_trace(GdkPixbuf *px, SPDesktop *desktop, NR::Matrix transform) { pathRepr->setAttribute("d", str); g_free(str); - // premultiply the item transform by the accumulated parent transform in the paste layer - NR::Matrix local = sp_item_i2doc_affine(SP_GROUP(desktop->currentLayer())); - if (!local.test_identity()) { - gchar const *t_str = pathRepr->attribute("transform"); - NR::Matrix item_t (NR::identity()); - if (t_str) - sp_svg_transform_read(t_str, &item_t); - item_t *= local.inverse(); - // (we're dealing with unattached repr, so we write to its attr instead of using sp_item_set_transform) - gchar affinestr[80]; - if (sp_svg_transform_write(affinestr, 79, item_t)) { - pathRepr->setAttribute("transform", affinestr); - } else { - pathRepr->setAttribute("transform", NULL); - } - } - layer_repr->addChild(pathRepr, NULL); SPObject *reprobj = document->getObjectByRepr(pathRepr); if (reprobj) { sp_item_write_transform(SP_ITEM(reprobj), pathRepr, transform, NULL); + + // premultiply the item transform by the accumulated parent transform in the paste layer + NR::Matrix local = sp_item_i2doc_affine(SP_GROUP(desktop->currentLayer())); + if (!local.test_identity()) { + gchar const *t_str = pathRepr->attribute("transform"); + NR::Matrix item_t (NR::identity()); + if (t_str) + sp_svg_transform_read(t_str, &item_t); + item_t *= local.inverse(); + // (we're dealing with unattached repr, so we write to its attr instead of using sp_item_set_transform) + gchar affinestr[80]; + if (sp_svg_transform_write(affinestr, 79, item_t)) { + pathRepr->setAttribute("transform", affinestr); + } else { + pathRepr->setAttribute("transform", NULL); + } + } + Inkscape::Selection *selection = sp_desktop_selection(desktop); selection->set(reprobj); pathRepr->setPosition(-1); |
