summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-05-09 00:57:05 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-05-09 00:57:05 +0000
commit13fc1db22c959600f7b179abf1a70ca42ab587de (patch)
treec24bf68fc7b0a506c5faf5a94b09745ab8086320 /src/selection-chemistry.cpp
parentfixed logic error in earlier fix (diff)
downloadinkscape-13fc1db22c959600f7b179abf1a70ca42ab587de.tar.gz
inkscape-13fc1db22c959600f7b179abf1a70ca42ab587de.zip
fix crash introduces by recent rev when clipping
(bzr r14133)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 4352878d6..a21a82983 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -3924,6 +3924,9 @@ 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)
+ std::vector<Inkscape::XML::Node*> mask_items_dup;
+ for(std::vector<Inkscape::XML::Node*>::const_iterator it=mask_items.begin();it!=mask_items.end();it++)
+ mask_items_dup.push_back((*it)->duplicate(xml_doc));
Inkscape::XML::Node *current = SP_OBJECT(*i)->getRepr();
// Node to apply mask to
Inkscape::XML::Node *apply_mask_to = current;
@@ -3949,15 +3952,13 @@ void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_
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);
+ mask_id = SPClipPath::create(mask_items_dup, doc, &maskTransform);
} else {
- mask_id = sp_mask_create(mask_items, doc, &maskTransform);
+ mask_id = sp_mask_create(mask_items_dup, doc, &maskTransform);
}
apply_mask_to->setAttribute(attributeName, Glib::ustring("url(#") + mask_id + ')');