summaryrefslogtreecommitdiffstats
path: root/src/node-context.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-02-23 21:25:08 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-02-23 21:25:08 +0000
commit171a382512eea79da11349674bd044ee8881ea48 (patch)
tree23a61702358853b0db796b1d330313d75ba39f91 /src/node-context.cpp
parent* Many files moved in SVN r20741, updating their references (diff)
downloadinkscape-171a382512eea79da11349674bd044ee8881ea48.tar.gz
inkscape-171a382512eea79da11349674bd044ee8881ea48.zip
Fix snapping when dragging gradients (implement the snap delay, use snap tolerances from the object snapper)
(bzr r7355)
Diffstat (limited to '')
-rw-r--r--src/node-context.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/node-context.cpp b/src/node-context.cpp
index ec86a4c80..4a36c5d61 100644
--- a/src/node-context.cpp
+++ b/src/node-context.cpp
@@ -102,7 +102,7 @@ sp_node_context_init(SPNodeContext *node_context)
node_context->rightalt = FALSE;
node_context->leftctrl = FALSE;
node_context->rightctrl = FALSE;
-
+
new (&node_context->sel_changed_connection) sigc::connection();
node_context->flash_tempitem = NULL;
@@ -113,9 +113,11 @@ sp_node_context_init(SPNodeContext *node_context)
static void
sp_node_context_dispose(GObject *object)
{
- SPNodeContext *nc = SP_NODE_CONTEXT(object);
+ SPNodeContext *nc = SP_NODE_CONTEXT(object);
SPEventContext *ec = SP_EVENT_CONTEXT(object);
+ sp_canvas_set_snap_delay_active(ec->desktop->canvas, false);
+
ec->enableGrDrag(false);
nc->sel_changed_connection.disconnect();
@@ -173,6 +175,8 @@ sp_node_context_setup(SPEventContext *ec)
nc->_node_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack());
ec->shape_editor->update_statusbar();
+
+ sp_canvas_set_snap_delay_active(ec->desktop->canvas, true);
}
static void
@@ -195,7 +199,7 @@ sp_node_context_flash_path(SPEventContext *event_context, SPItem *item, guint ti
} else {
g_print ("-----> sp_node_context_flash_path(): TODO: generate the helper path!!\n");
}
-
+
if (canvasitem) {
nc->flash_tempitem = desktop->add_temporary_canvasitem (canvasitem, timeout);
}
@@ -214,7 +218,7 @@ sp_node_context_selection_changed(Inkscape::Selection *selection, gpointer data)
// TODO: update ShapeEditorsCollective instead
ec->shape_editor->unset_item(SH_NODEPATH);
ec->shape_editor->unset_item(SH_KNOTHOLDER);
- SPItem *item = selection->singleItem();
+ SPItem *item = selection->singleItem();
ec->shape_editor->set_item(item, SH_NODEPATH);
ec->shape_editor->set_item(item, SH_KNOTHOLDER);
ec->shape_editor->update_statusbar();
@@ -321,7 +325,7 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event)
// The path went away while dragging; throw away any further motion
// events until the mouse pointer is released.
-
+
if (se->hits_curve() && !se->has_nodepath()) {
break;
}
@@ -441,7 +445,7 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event)
ret = TRUE;
break;
}
- }
+ }
if (event->type == GDK_BUTTON_RELEASE) {
event_context->xp = event_context->yp = 0;
if (event->button.button == 1) {