From 8ccc9fe56c4cef028d1e019265ca14d1c6357c84 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 19 Jul 2016 14:29:25 +0000 Subject: [PATCH] When snapping constraints to grid, snap the reference point. --- src/graphicswin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 6ed60ab..9f84fd1 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -910,7 +910,9 @@ void GraphicsWindow::MenuEdit(Command id) { SS.MarkGroupDirty(ep->group); } else if(s->constraint.v) { Constraint *c = SK.GetConstraint(s->constraint); - c->disp.offset = SS.GW.SnapToGrid(c->disp.offset); + Vector refp[2]; + c->GetReferencePos(refp); + c->disp.offset = c->disp.offset.Plus(SS.GW.SnapToGrid(refp[0]).Minus(refp[0])); } } // Regenerate, with these points marked as dragged so that they