summaryrefslogtreecommitdiffstats
path: root/src/gradient-context.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2007-03-20 21:14:34 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2007-03-20 21:14:34 +0000
commit8c6aca4358672a5c71a922ead85f2a9fc327a861 (patch)
tree8d0bca07eeef55a497d578d0b128a468a16ee2a6 /src/gradient-context.cpp
parentMonster commit. New grid infrastructure. The old gridmanagement code is still... (diff)
downloadinkscape-8c6aca4358672a5c71a922ead85f2a9fc327a861.tar.gz
inkscape-8c6aca4358672a5c71a922ead85f2a9fc327a861.zip
Implementing feature request #1673807: snapping of gradient handles
(bzr r2722)
Diffstat (limited to 'src/gradient-context.cpp')
-rw-r--r--src/gradient-context.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gradient-context.cpp b/src/gradient-context.cpp
index c44cf1c59..42b4df578 100644
--- a/src/gradient-context.cpp
+++ b/src/gradient-context.cpp
@@ -44,7 +44,8 @@
#include "sp-stop.h"
#include "svg/css-ostringstream.h"
#include "svg/svg-color.h"
-
+#include "snap.h"
+#include "sp-namedview.h"
@@ -410,8 +411,9 @@ sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event)
/* Position center */
NR::Point const button_dt = desktop->w2d(button_w);
/* Snap center to nearest magnetic point */
-
- rc->origin = button_dt;
+
+ SnapManager const &m = desktop->namedview->snap_manager;
+ rc->origin = m.freeSnap(Inkscape::Snapper::BBOX_POINT | Inkscape::Snapper::SNAP_POINT, button_dt, NULL).getPoint();
ret = TRUE;
}