summaryrefslogtreecommitdiffstats
path: root/src/pencil-context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pencil-context.cpp')
-rw-r--r--src/pencil-context.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp
index d823c1daa..d67833a91 100644
--- a/src/pencil-context.cpp
+++ b/src/pencil-context.cpp
@@ -166,12 +166,15 @@ static void
spdc_endpoint_snap(SPPencilContext const *pc, Geom::Point &p, guint const state)
{
if ((state & GDK_CONTROL_MASK)) { //CTRL enables constrained snapping
- spdc_endpoint_snap_rotation(pc, p, pc->p[0], state);
+ if (pc->npoints > 0) {
+ spdc_endpoint_snap_rotation(pc, p, pc->p[0], state);
+ }
} else {
if (!(state & GDK_SHIFT_MASK)) { //SHIFT disables all snapping, except the angular snapping above
//After all, the user explicitely asked for angular snapping by
//pressing CTRL
- spdc_endpoint_snap_free(pc, p, state);
+ boost::optional<Geom::Point> origin = pc->npoints > 0 ? pc->p[0] : boost::optional<Geom::Point>();
+ spdc_endpoint_snap_free(pc, p, origin, state);
}
}
}