summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2006-05-03 11:01:57 +0000
committercth103 <cth103@users.sourceforge.net>2006-05-03 11:01:57 +0000
commit672c5870a6c912439bc0fc2655ed4368b2007082 (patch)
tree6435ef7371b017bb318cab12ef82864086826cd7 /src/desktop.cpp
parentsmall update for 1480247 fix (cleaned up the redundant code) (diff)
downloadinkscape-672c5870a6c912439bc0fc2655ed4368b2007082.tar.gz
inkscape-672c5870a6c912439bc0fc2655ed4368b2007082.zip
Give SPNamedView a SnapManager instance and use it for all management of snapping settings.
(bzr r701)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 5db7e5d24..05d20b31b 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -1247,6 +1247,9 @@ _namedview_modified (SPNamedView *nv, guint flags, SPDesktop *desktop)
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* Recalculate snap distances */
+ /* FIXME: why is the desktop getting involved in setting up something
+ ** that is entirely to do with the namedview?
+ */
_update_snap_distances (desktop);
/* Show/hide page background */
@@ -1312,15 +1315,15 @@ _update_snap_distances (SPDesktop *desktop)
SPNamedView &nv = *desktop->namedview;
- nv.grid_snapper.setDistance(sp_convert_distance_full(nv.gridtolerance,
- *nv.gridtoleranceunit,
- px));
- nv.guide_snapper.setDistance(sp_convert_distance_full(nv.guidetolerance,
- *nv.guidetoleranceunit,
- px));
- nv.object_snapper.setDistance(sp_convert_distance_full(nv.objecttolerance,
- *nv.objecttoleranceunit,
- px));
+ nv.snap_manager.grid.setDistance(sp_convert_distance_full(nv.gridtolerance,
+ *nv.gridtoleranceunit,
+ px));
+ nv.snap_manager.guide.setDistance(sp_convert_distance_full(nv.guidetolerance,
+ *nv.guidetoleranceunit,
+ px));
+ nv.snap_manager.object.setDistance(sp_convert_distance_full(nv.objecttolerance,
+ *nv.objecttoleranceunit,
+ px));
}