From 3b35e676c9107f8627587365f6e01ebf0093e9c5 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 25 Jan 2009 13:35:08 +0000 Subject: - The snap-delay mechanism should now be more robust. From now on, it must be turned on and off explicitely within each context. This prevents delayed snapping events from being fired after the context or context's state has changed. - Creating single dots now snaps (bzr r7172) --- src/snap.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/snap.cpp') diff --git a/src/snap.cpp b/src/snap.cpp index 24cfefe0b..11ba077e4 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -13,7 +13,7 @@ * * Copyright (C) 2006-2007 Johan Engelen * Copyrigth (C) 2004 Nathan Hurst - * Copyright (C) 1999-2008 Authors + * Copyright (C) 1999-2009 Authors * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -162,7 +162,12 @@ Inkscape::SnappedPoint SnapManager::freeSnap(Inkscape::SnapPreferences::PointTyp bool first_point, Geom::OptRect const &bbox_to_snap) const { - if (!someSnapperMightSnap()) { + if (_desktop->canvas->context_snap_delay_active == false) { + g_warning("context_snap_delay_active has not been set to true by the current context. Please report this!"); + // When the context goes into dragging-mode, then Inkscape should call this: sp_canvas_set_snap_delay_active(desktop->canvas, true); + } + + if (!someSnapperMightSnap()) { return Inkscape::SnappedPoint(p, Inkscape::SNAPTARGET_UNDEFINED, NR_HUGE, 0, false, false); } @@ -286,7 +291,12 @@ Inkscape::SnappedPoint SnapManager::constrainedSnap(Inkscape::SnapPreferences::P bool first_point, Geom::OptRect const &bbox_to_snap) const { - if (!someSnapperMightSnap()) { + if (_desktop->canvas->context_snap_delay_active == false) { + g_warning("context_snap_delay_active has not been set to true by the current context. Please report this!"); + // When the context goes into dragging-mode, then Inkscape should call this: sp_canvas_set_snap_delay_active(desktop->canvas, true); + } + + if (!someSnapperMightSnap()) { return Inkscape::SnappedPoint(p, Inkscape::SNAPTARGET_UNDEFINED, NR_HUGE, 0, false, false); } @@ -317,6 +327,11 @@ void SnapManager::guideSnap(Geom::Point &p, Geom::Point const &guide_normal) con { // This method is used to snap a guide to nodes, while dragging the guide around + if (_desktop->canvas->context_snap_delay_active == false) { + g_warning("context_snap_delay_active has not been set to true by the current context. Please report this!"); + // When the context goes into dragging-mode, then Inkscape should call this: sp_canvas_set_snap_delay_active(desktop->canvas, true); + } + if ( !(object.GuidesMightSnap() && snapprefs.getSnapEnabledGlobally()) || snapprefs.getSnapPostponedGlobally() ) { return; } -- cgit v1.2.3