When snapping constraints to grid, snap the reference point.

This commit is contained in:
whitequark 2016-07-19 14:29:25 +00:00
parent 8747745a14
commit 8ccc9fe56c

View File

@ -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