diff options
| author | John Bintz <me@johnbintz.com> | 2007-02-28 01:50:21 +0000 |
|---|---|---|
| committer | johncoswell <johncoswell@users.sourceforge.net> | 2007-02-28 01:50:21 +0000 |
| commit | bf9e8d3e4cda17b56a58d6a706ddde13e120acf1 (patch) | |
| tree | 688f8cc701ffa7b5e05bd8dcd6aa18025e01d469 /src | |
| parent | Change paint bucket tolerance toolbar to use percentages rather than color ch... (diff) | |
| download | inkscape-bf9e8d3e4cda17b56a58d6a706ddde13e120acf1.tar.gz inkscape-bf9e8d3e4cda17b56a58d6a706ddde13e120acf1.zip | |
Fix issue with adding traced path to a layer with a transform
(bzr r2464)
Diffstat (limited to 'src')
| -rw-r--r-- | src/flood-context.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/flood-context.cpp b/src/flood-context.cpp index d1c2ad65b..467d47de7 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -331,7 +331,24 @@ static void do_trace(GdkPixbuf *px, SPDesktop *desktop, NR::Matrix transform) { delete expanded_path; 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); |
