summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa358f8)
raw | patch | inline | side by side (parent: fa358f8)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 24 Feb 2007 18:45:44 +0000 (18:45 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 24 Feb 2007 18:45:44 +0000 (18:45 +0000) |
src/selection-chemistry.cpp | patch | blob | history |
index 541d04fff12d97e068891823c7f13ba2f240131a..cf16aba60a76d84a97e3ce27c648c5b57a8fe1ba 100644 (file)
g_slist_free ((GSList *) items);
}
+bool
+selection_contains_both_clone_and_original (Inkscape::Selection *selection)
+{
+ bool clone_with_original = false;
+ for (GSList const *l = selection->itemList(); l != NULL; l = l->next) {
+ SPItem *item = SP_ITEM(l->data);
+ bool is_use = SP_IS_USE(item);
+ SPItem *item_use = item;
+ SPItem *item_use_first = item;
+ while (is_use && item_use && !clone_with_original)
+ {
+ item_use = sp_use_get_original (SP_USE(item_use));
+ clone_with_original |= selection->includes(item_use);
+ if (item_use == item_use_first)
+ break;
+ is_use = SP_IS_USE(item_use);
+ }
+ if (clone_with_original)
+ break;
+ }
+ return clone_with_original;
+}
+
+
/** Apply matrix to the selection. \a set_i2d is normally true, which means objects are in the
original transform, synced with their reprs, and need to jump to the new transform in one go. A
value of set_i2d==false is only used by seltrans when it's dragging objects live (not outlines); in
// FIXME: temporary patch to prevent crash!
// Remove this when bboxes are fixed to not blow up on an item clipped/masked with its own clone
- bool clone_with_original = false;
- for (GSList const *l = selection->itemList(); l != NULL; l = l->next) {
- SPItem *item = SP_ITEM(l->data);
- bool is_use = SP_IS_USE(item);
- SPItem *item_use = item;
- SPItem *item_use_first = item;
- while (is_use && item_use && !clone_with_original)
- {
- item_use = sp_use_get_original (SP_USE(item_use));
- clone_with_original |= selection->includes(item_use);
- if (item_use == item_use_first)
- break;
- is_use = SP_IS_USE(item_use);
- }
- if (clone_with_original)
- break;
- }
+ bool clone_with_original = selection_contains_both_clone_and_original (selection);
if (clone_with_original) {
return; // in this version, you cannot clip/mask an object with its own clone
}