summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2007-03-26 22:29:17 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2007-03-26 22:29:17 +0000
commit102c95490212a3f38b299cf2188bdabf00f79a64 (patch)
tree1a44a299944311d0ef5ebc62521a08cacea6a87a /src
parentfix range, make integer, remove unnecessary document_done, fix 1635388 (diff)
downloadinkscape-102c95490212a3f38b299cf2188bdabf00f79a64.tar.gz
inkscape-102c95490212a3f38b299cf2188bdabf00f79a64.zip
Selector tool shouldn't snap to path nodes, see Bulia's comment in bug #1589436
(bzr r2767)
Diffstat (limited to 'src')
-rw-r--r--src/selection.cpp11
-rw-r--r--src/selection.h2
-rw-r--r--src/sp-item-group.cpp7
-rw-r--r--src/sp-shape.cpp8
4 files changed, 20 insertions, 8 deletions
diff --git a/src/selection.cpp b/src/selection.cpp
index 201661eec..05bd8d030 100644
--- a/src/selection.cpp
+++ b/src/selection.cpp
@@ -27,6 +27,7 @@
#include "xml/repr.h"
#include "sp-shape.h"
+#include "sp-path.h"
#include <sigc++/functors/mem_fun.h>
@@ -367,12 +368,20 @@ NR::Maybe<NR::Point> Selection::center() const {
/**
* 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 f9368f5ee..34de82c7c 100644
--- a/src/selection.h
+++ b/src/selection.h
@@ -71,7 +71,7 @@ public:
~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 d4fa9536d..f43f4ded9 100644
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
@@ -34,6 +34,7 @@
#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);
@@ -297,8 +298,10 @@ static void sp_group_snappoints (SPItem const *item, SnapPointsIter p)
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 cfeee3a29..453de5650 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -88,19 +88,19 @@ sp_shape_get_type (void)
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;
@@ -111,7 +111,7 @@ sp_shape_class_init (SPShapeClass *klass)
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;
}
/**