summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8935f7f)
raw | patch | inline | side by side (parent: 8935f7f)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 29 Dec 2008 05:31:53 +0000 (05:31 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 29 Dec 2008 05:31:53 +0000 (05:31 +0000) |
src/path-chemistry.cpp | patch | blob | history |
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index 0227e9caf5feaef2c283f48623737e6401257d0e..6ef4b27423d4f07fd2d8cf4d6df651f30fef1bd2 100644 (file)
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
#include "desktop-handles.h"
#include "box3d.h"
#include <2geom/pathvector.h>
+#include "selection-chemistry.h"
#include "path-chemistry.h"
void
Inkscape::Selection *selection = sp_desktop_selection(desktop);
SPDocument *doc = sp_desktop_document(desktop);
- if (g_slist_length((GSList *) selection->itemList()) < 2) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>at least two objects</b> to combine."));
+ if (g_slist_length((GSList *) selection->itemList()) < 1) {
+ sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to combine."));
return;
}
desktop->setWaitingCursor();
GSList *items = g_slist_copy((GSList *) selection->itemList());
+
+ items = sp_degroup_list (items); // descend into any groups in selection
+
GSList *to_paths = NULL;
for (GSList *i = items; i != NULL; i = i->next) {
SPItem *item = (SPItem *) i->data;
- if (!SP_IS_PATH(item))
+ if (!SP_IS_PATH(item) && !SP_IS_GROUP(item))
to_paths = g_slist_prepend(to_paths, item);
}
GSList *converted = NULL;
for (GSList *i = converted; i != NULL; i = i->next)
items = g_slist_prepend(items, doc->getObjectByRepr((Inkscape::XML::Node*)(i->data)));
+ items = sp_degroup_list (items); // converting to path may have added more groups, descend again
+
items = g_slist_sort(items, (GCompareFunc) sp_item_repr_compare_position);
items = g_slist_reverse(items);