summaryrefslogtreecommitdiffstats
path: root/src/gradient-context.cpp
diff options
context:
space:
mode:
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;
}