summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd07de6)
raw | patch | inline | side by side (parent: fd07de6)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 9 Mar 2009 20:19:01 +0000 (20:19 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 9 Mar 2009 20:19:01 +0000 (20:19 +0000) |
index 75a1f4e63cba6fe9fd28831353be38144952ca68..0f9e883ed4376a9db8a9bb700b9e282d381010b2 100644 (file)
dt->namedview->snap_manager.snapprefs.setSnapPostponedGlobally(false);
}
+ ((GdkEventMotion *)canvas->watchdog_event)->time = GDK_CURRENT_TIME;
emit_event(canvas, canvas->watchdog_event);
gdk_event_free(canvas->watchdog_event);
canvas->watchdog_event = NULL;
diff --git a/src/knot.cpp b/src/knot.cpp
index cf1a3e9444e8194d15a97b9c16a6b8973b5cbfaf..fab622bbd10ac3d190d149947e3c6c4801ded606 100644 (file)
--- a/src/knot.cpp
+++ b/src/knot.cpp
*/
static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot)
{
- g_assert(knot != NULL);
+ static bool snap_delay_temporarily_active = false;
+
+ g_assert(knot != NULL);
g_assert(SP_IS_KNOT(knot));
/* Run client universal event handler, if present */
@@ -316,6 +318,10 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot
if (event->button.button == 1 && !knot->desktop->event_context->space_panning) {
Geom::Point const p = knot->desktop->w2d(Geom::Point(event->button.x, event->button.y));
sp_knot_start_dragging(knot, p, (gint) event->button.x, (gint) event->button.y, event->button.time);
+ if (knot->desktop->canvas->context_snap_delay_active == false) {
+ sp_canvas_set_snap_delay_active(knot->desktop->canvas, true);
+ snap_delay_temporarily_active = true;
+ }
consumed = TRUE;
}
break;
@@ -347,6 +353,13 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot
grabbed = FALSE;
moved = FALSE;
consumed = TRUE;
+
+ if (snap_delay_temporarily_active) {
+ if (knot->desktop->canvas->context_snap_delay_active == true) {
+ sp_canvas_set_snap_delay_active(knot->desktop->canvas, false);
+ }
+ snap_delay_temporarily_active = false;
+ }
}
}
break;
@@ -411,7 +424,6 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot
grabbed = FALSE;
moved = FALSE;
-
consumed = TRUE;
break;
case GDK_KEY_PRESS: // keybindings for knot
@@ -435,6 +447,10 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot
}
grabbed = FALSE;
moved = FALSE;
+ if (snap_delay_temporarily_active) {
+ sp_canvas_set_snap_delay_active(knot->desktop->canvas, false);
+ snap_delay_temporarily_active = false;
+ }
break;
default:
consumed = FALSE;
}
/**
- * Move knot to new position, without emitting a MOVED signal.
+ * Move knot to new position, without emitting a MOVED signal.
*/
void sp_knot_moveto(SPKnot *knot, Geom::Point const &p)
{
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index eaf5658f803dc5cb3db25637b366875dfece1846..60c1f80846a965a882401b4a16846771644573c9 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
{
if (this->dragging == false) {
this->dragging = true;
- sp_canvas_set_snap_delay_active(desktop->canvas, true);
+ //sp_canvas_set_snap_delay_active(desktop->canvas, true);
}
// this was a local change and the knotholder does not need to be recreated:
KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/)
{
this->dragging = false;
- sp_canvas_set_snap_delay_active(desktop->canvas, false);
+ //sp_canvas_set_snap_delay_active(desktop->canvas, false);
if (this->released) {
this->released(this->item);
diff --git a/src/node-context.cpp b/src/node-context.cpp
index 57af59bd4d8ce945d5d313c692936b5b05a8b480..f40d1b7fc79927f69c76674e3e46ec790e45cb14 100644 (file)
--- a/src/node-context.cpp
+++ b/src/node-context.cpp
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();
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
if (!(event->button.state & GDK_SHIFT_MASK)) {
if (!nc->drag) {
if (se->has_nodepath() && selection->single() /* && item_over */) {
- // save drag origin
+ sp_canvas_set_snap_delay_active(desktop->canvas, true);
+ // save drag origin
bool over_stroke = se->is_over_stroke(Geom::Point(event->button.x, event->button.y), true);
//only dragging curves
if (over_stroke) {
if (over_stroke || nc->added_node) {
switch (event->type) {
case GDK_BUTTON_RELEASE:
- if (event->button.state & GDK_CONTROL_MASK && event->button.state & GDK_MOD1_MASK) {
+ if (event->button.state & GDK_CONTROL_MASK && event->button.state & GDK_MOD1_MASK) {
//add a node
se->add_node_near_point();
} else {
}
desktop->updateNow();
}
+ sp_canvas_set_snap_delay_active(desktop->canvas, false);
break;
case GDK_2BUTTON_PRESS:
//add a node
se->add_node_near_point();
nc->added_node = true;
+ sp_canvas_set_snap_delay_active(desktop->canvas, false);
break;
default:
break;
}
}
if (event->type == GDK_BUTTON_RELEASE) {
- event_context->xp = event_context->yp = 0;
+ event_context->xp = event_context->yp = 0;
if (event->button.button == 1) {
- Geom::OptRect b = Inkscape::Rubberband::get(desktop)->getRectangle();
+ Geom::OptRect b = Inkscape::Rubberband::get(desktop)->getRectangle();
if (se->hits_curve() && !event_context->within_tolerance) { //drag curve
se->finish_drag();
} else if (b && !event_context->within_tolerance) { // drag to select
se->select_rect(*b, event->button.state & GDK_SHIFT_MASK);
} else {
- if (!(nc->rb_escaped)) { // unless something was cancelled
+ if (!(nc->rb_escaped)) { // unless something was canceled
if (se->has_selection())
se->deselect();
else
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 318649e5ff53b6e81f94ad1dece7c538ea4a2d7a..51d4b9bef8395d07f904881e1644e3a589934948 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
}
n->is_dragging = true;
- sp_canvas_set_snap_delay_active(n->subpath->nodepath->desktop->canvas, true);
+ //sp_canvas_set_snap_delay_active(n->subpath->nodepath->desktop->canvas, true);
// Reconstruct and store the location of the mouse pointer at the time when we started dragging (needed for snapping)
n->subpath->nodepath->drag_origin_mouse = knot->grabbed_rel_pos + knot->drag_origin;
n->dragging_out = NULL;
n->is_dragging = false;
- sp_canvas_set_snap_delay_active(n->subpath->nodepath->desktop->canvas, false);
+ //sp_canvas_set_snap_delay_active(n->subpath->nodepath->desktop->canvas, false);
n->subpath->nodepath->drag_origin_mouse = Geom::Point(NR_HUGE, NR_HUGE);
sp_canvas_end_forced_full_redraws(n->subpath->nodepath->desktop->canvas);