Make "Toggle Reference" remember undo state.

Turning a reference dimension into a constraint one can make
the sketch unsolvable, which suggests Edit → Undo, which would undo
either too much or nothing at all.
This commit is contained in:
whitequark 2020-07-28 13:12:14 +00:00
parent e0fa99bad4
commit 56e2592e2a

View File

@ -558,6 +558,7 @@ void Constraint::MenuConstrain(Command id) {
if(gs.constraints == 1 && gs.n == 0) {
Constraint *c = SK.GetConstraint(gs.constraint[0]);
if(c->HasLabel() && c->type != Type::COMMENT) {
SS.UndoRemember();
(c->reference) = !(c->reference);
SS.MarkGroupDirty(c->group, /*onlyThis=*/true);
break;