diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-05-08 23:50:13 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-05-08 23:50:13 +0000 |
| commit | 31c3977006f63720ca6aa473585760da7d59a833 (patch) | |
| tree | fcacdf86839fdb1448f883743ad967fd79418238 /src/selection-chemistry.cpp | |
| parent | refactor sp_selection_set_mask (diff) | |
| download | inkscape-31c3977006f63720ca6aa473585760da7d59a833.tar.gz inkscape-31c3977006f63720ca6aa473585760da7d59a833.zip | |
fixed logic error in earlier fix
(bzr r14132)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 7be1e3ec0..4352878d6 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3924,15 +3924,6 @@ void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_ SPItem *item = reinterpret_cast<SPItem *>(*i); // inverted object transform should be applied to a mask object, // as mask is calculated in user space (after applying transform) - Geom::Affine maskTransform(item->i2doc_affine().inverse()); - - gchar const *mask_id = NULL; - if (apply_clip_path) { - mask_id = SPClipPath::create(mask_items, doc, &maskTransform); - } else { - mask_id = sp_mask_create(mask_items, doc, &maskTransform); - } - Inkscape::XML::Node *current = SP_OBJECT(*i)->getRepr(); // Node to apply mask to Inkscape::XML::Node *apply_mask_to = current; @@ -3953,11 +3944,22 @@ void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_ // Apply clip/mask to group instead apply_mask_to = group; - items_to_select.push_back((SPItem*)(doc->getObjectByRepr(group))); + items_to_select.push_back(item = (SPItem*)(doc->getObjectByRepr(group))); Inkscape::GC::release(spnew); Inkscape::GC::release(group); } + + + Geom::Affine maskTransform(item->i2doc_affine().inverse()); + + gchar const *mask_id = NULL; + if (apply_clip_path) { + mask_id = SPClipPath::create(mask_items, doc, &maskTransform); + } else { + mask_id = sp_mask_create(mask_items, doc, &maskTransform); + } + apply_mask_to->setAttribute(attributeName, Glib::ustring("url(#") + mask_id + ')'); } |
