diff --git a/src/selection.cpp b/src/selection.cpp
index 44f601362e1494eedce9c43b9a8381d5e3be7391..af5db825c0c19efc905bfef8a4559a298fa10da9 100644 (file)
--- a/src/selection.cpp
+++ b/src/selection.cpp
#include "sp-shape.h"
#include "sp-path.h"
+#include "sp-item-group.h"
#include <sigc++/functors/mem_fun.h>
* Compute the list of points in the selection that are to be considered for snapping.
* This includes all special points of each item in the selection, except path nodes
*/
-std::vector<NR::Point> Selection::getSnapPoints() const {
+std::vector<NR::Point> Selection::getSnapPoints(bool includeItemCenter) const {
GSList const *items = const_cast<Selection *>(this)->itemList();
std::vector<NR::Point> p;
for (GSList const *iter = items; iter != NULL; iter = iter->next) {
if (!SP_IS_PATH(this_item)) {
// Only snap if we don't have a path at hand
// (Same check occurs in sp-item-group)
- sp_item_snappoints(this_item, SnapPointsIter(p));
+ sp_item_snappoints(this_item, false, SnapPointsIter(p));
}
+ //Include the transformation origin for snapping
+ //For a group only the group's origin is considered
+ if (includeItemCenter) {
+ p.push_back(this_item->getCenter());
+ }
}
return p;
std::vector<NR::Point> p;
for (GSList const *iter = items; iter != NULL; iter = iter->next) {
- sp_item_snappoints(SP_ITEM(iter->data), SnapPointsIter(p));
+ sp_item_snappoints(SP_ITEM(iter->data), false, SnapPointsIter(p));
}
std::vector<NR::Point> pHull;