summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-01-25 13:35:08 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-01-25 13:35:08 +0000
commit3b35e676c9107f8627587365f6e01ebf0093e9c5 (patch)
tree8e5d306024820cf9b2adf2e5b4d4735959c8803e /src/snap.cpp
parentremoving void files (diff)
downloadinkscape-3b35e676c9107f8627587365f6e01ebf0093e9c5.tar.gz
inkscape-3b35e676c9107f8627587365f6e01ebf0093e9c5.zip
- 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)
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp21
1 files changed, 18 insertions, 3 deletions
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 <johan@shouraizou.nl>
* 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;
}