summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5ae629c)
raw | patch | inline | side by side (parent: 5ae629c)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 26 Mar 2007 22:29:17 +0000 (22:29 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 26 Mar 2007 22:29:17 +0000 (22:29 +0000) |
src/selection.cpp | patch | blob | history | |
src/selection.h | patch | blob | history | |
src/sp-item-group.cpp | patch | blob | history | |
src/sp-shape.cpp | patch | blob | history |
diff --git a/src/selection.cpp b/src/selection.cpp
index 201661eecc89345575aede6f4195c8ce66ef1efb..05bd8d030283fd1d94d40fb2dfe46e8ba933fcba 100644 (file)
--- a/src/selection.cpp
+++ b/src/selection.cpp
#include "xml/repr.h"
#include "sp-shape.h"
+#include "sp-path.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 {
GSList const *items = const_cast<Selection *>(this)->itemList();
std::vector<NR::Point> p;
for (GSList const *iter = items; iter != NULL; iter = iter->next) {
- sp_item_snappoints(SP_ITEM(iter->data), SnapPointsIter(p));
+ // getSnapPoints() is only being used in the selector tool, which should
+ // not snap path nodes. Only the node tool should snap those.
+ SPItem *this_item = SP_ITEM(iter->data);
+ 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));
+ }
}
return p;
diff --git a/src/selection.h b/src/selection.h
index f9368f5eef5e5898e72460f2abf218057b84151e..34de82c7ce7df69d7c3dbe0776edb73df2d3580b 100644 (file)
--- a/src/selection.h
+++ b/src/selection.h
~Selection();
/**
- * @brief Returns the desktop the seoection is bound to
+ * @brief Returns the desktop the selection is bound to
*
* @return the desktop the selection is bound to
*/
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index d4fa9536d4cf246c7ea31e970330896a3d4dc414..f43f4ded952fd4c9f0be6a3a41969fa5a98f5b10 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
#include "prefs-utils.h"
#include "sp-clippath.h"
#include "sp-mask.h"
+#include "sp-path.h"
static void sp_group_class_init (SPGroupClass *klass);
static void sp_group_init (SPGroup *group);
o != NULL;
o = SP_OBJECT_NEXT(o))
{
- if (SP_IS_ITEM(o)) {
- sp_item_snappoints(SP_ITEM(o), p);
+ if (SP_IS_ITEM(o) && !SP_IS_PATH(o)) {
+ // getSnapPoints() and sp_group_snappoints are only being used in the selector tool,
+ // which should not snap path nodes. Only the node tool should snap those.
+ sp_item_snappoints(SP_ITEM(o), p);
}
}
}
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index cfeee3a29be1b33ad30073cc7c3d38d058a34317..453de5650fd017971a280a7c1c7ad069e69446cf 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
static void
sp_shape_class_init (SPShapeClass *klass)
{
- GObjectClass *gobject_class;
+ GObjectClass *gobject_class;
SPObjectClass *sp_object_class;
SPItemClass * item_class;
SPPathClass * path_class;
- gobject_class = (GObjectClass *) klass;
+ gobject_class = (GObjectClass *) klass;
sp_object_class = (SPObjectClass *) klass;
item_class = (SPItemClass *) klass;
path_class = (SPPathClass *) klass;
parent_class = (SPItemClass *)g_type_class_peek_parent (klass);
- gobject_class->finalize = sp_shape_finalize;
+ gobject_class->finalize = sp_shape_finalize;
sp_object_class->build = sp_shape_build;
sp_object_class->release = sp_shape_release;
item_class->print = sp_shape_print;
item_class->show = sp_shape_show;
item_class->hide = sp_shape_hide;
- item_class->snappoints = sp_shape_snappoints;
+ item_class->snappoints = sp_shape_snappoints;
}
/**