Sketcher: [skip ci] fix undo bug when directly changing a datum constraint in the property editor

This commit is contained in:
wmayer
2020-09-23 16:59:23 +02:00
parent 50284e1ef2
commit 3e7e2a9bc4

View File

@@ -23,6 +23,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <memory>
# include <QDebug>
# include <QTextStream>
#endif
@@ -337,8 +338,9 @@ bool PropertyConstraintListItem::event (QEvent* ev)
double datum = quant.getValue();
if ((*it)->Type == Sketcher::Angle)
datum = Base::toRadians<double>(datum);
const_cast<Sketcher::Constraint *>((*it))->setValue(datum);
item->set1Value(id,(*it));
std::unique_ptr<Sketcher::Constraint> copy((*it)->clone());
copy->setValue(datum);
item->set1Value(id, copy.get());
break;
}
}