summaryrefslogtreecommitdiffstats
path: root/src/snap-preferences.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2011-10-08 20:00:37 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2011-10-08 20:00:37 +0000
commitf4c59e50df9090a1a4801da06f9a0021b67ce7a2 (patch)
tree825ce1a6b013c238a89f06c2fdf74cee0861e02b /src/snap-preferences.cpp
parentDoc. Keys and mouse reference update. (diff)
downloadinkscape-f4c59e50df9090a1a4801da06f9a0021b67ce7a2.tar.gz
inkscape-f4c59e50df9090a1a4801da06f9a0021b67ce7a2.zip
1) make snapping to clip/mask paths optional (see document properties dialog -> snap tab)
2) for debugging purposes: code added for showing all snap candidates 3) groundwork for tangential/perpendicular snapping (bzr r10672)
Diffstat (limited to 'src/snap-preferences.cpp')
-rw-r--r--src/snap-preferences.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/snap-preferences.cpp b/src/snap-preferences.cpp
index 250f38b90..b3a95877f 100644
--- a/src/snap-preferences.cpp
+++ b/src/snap-preferences.cpp
@@ -151,7 +151,6 @@ void Inkscape::SnapPreferences::_mapTargetToArrayIndex(Inkscape::SnapTargetType
target = SNAPTARGET_PATH_INTERSECTION;
}
-
} else if (target & SNAPTARGET_DATUMS_CATEGORY) {
group_on = true; // These snap targets cannot be disabled as part of a disabled group;
switch (target) {
@@ -257,6 +256,8 @@ bool Inkscape::SnapPreferences::isTargetSnappable(Inkscape::SnapTargetType const
if (_active_snap_targets[index] == -1) {
// Catch coding errors
g_warning("Snap-preferences warning: Using an uninitialized snap target setting (#%i)", index);
+ // This happens if setTargetSnappable() has not been called for this parameter, e.g. from within sp_namedview_set,
+ // or if this target index doesn't exist at all
}
return _active_snap_targets[index];
}
@@ -292,6 +293,8 @@ bool Inkscape::SnapPreferences::isSnapButtonEnabled(Inkscape::SnapTargetType con
if (_active_snap_targets[index] == -1) {
// Catch coding errors
g_warning("Snap-preferences warning: Using an uninitialized snap target setting (#%i)", index);
+ // This happens if setTargetSnappable() has not been called for this parameter, e.g. from within sp_namedview_set,
+ // or if this target index doesn't exist at all
} else {
if (index == target) { // I.e. if it has not been re-mapped, then we have a primary target at hand, which does have its own toggle button
return _active_snap_targets[index];