summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index a92cb1a73..91686d277 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -842,10 +842,10 @@ void sp_copy_pattern (GSList **defs_clip, SPPattern *pattern)
}
}
-void sp_copy_marker (GSList **defs_clip, SPMarker *marker)
+void sp_copy_single (GSList **defs_clip, SPObject *thing)
{
- Inkscape::XML::Node *marker_repr = SP_OBJECT_REPR(marker)->duplicate();
- *defs_clip = g_slist_prepend (*defs_clip, marker_repr);
+ Inkscape::XML::Node *duplicate_repr = SP_OBJECT_REPR(thing)->duplicate();
+ *defs_clip = g_slist_prepend (*defs_clip, duplicate_repr);
}
@@ -884,7 +884,7 @@ void sp_copy_stuff_used_by_item (GSList **defs_clip, SPItem *item, const GSList
SPShape *shape = SP_SHAPE (item);
for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) {
if (shape->marker[i]) {
- sp_copy_marker (defs_clip, SP_MARKER (shape->marker[i]));
+ sp_copy_single (defs_clip, SP_OBJECT (shape->marker[i]));
}
}
}
@@ -893,6 +893,20 @@ void sp_copy_stuff_used_by_item (GSList **defs_clip, SPItem *item, const GSList
sp_copy_textpath_path (defs_clip, SP_TEXTPATH(sp_object_first_child(SP_OBJECT(item))), items);
}
+ if (item->clip_ref->getObject()) {
+ sp_copy_single (defs_clip, item->clip_ref->getObject());
+ }
+
+ if (item->mask_ref->getObject()) {
+ SPObject *mask = item->mask_ref->getObject();
+ sp_copy_single (defs_clip, mask);
+ // recurse into the mask for its gradients etc.
+ for (SPObject *o = SP_OBJECT(mask)->children; o != NULL; o = o->next) {
+ if (SP_IS_ITEM(o))
+ sp_copy_stuff_used_by_item (defs_clip, SP_ITEM (o), items);
+ }
+ }
+
// recurse
for (SPObject *o = SP_OBJECT(item)->children; o != NULL; o = o->next) {
if (SP_IS_ITEM(o))