Fixed undo/redo issue when clear method of FacetsAnnotation and ModelConfig
reset timestamp to 1. This led to a bug where e.g. deleting painted facets through the respective item in object list followed by possible other actions and undo restored the painted facets from the time when the project was loaded. I'm not sure if there was any other situation where this problem manifested.
This commit is contained in:
@@ -1064,7 +1064,9 @@ Points get_bed_shape(const SLAPrinterConfig &cfg);
|
||||
class ModelConfig
|
||||
{
|
||||
public:
|
||||
void clear() { m_data.clear(); m_timestamp = 1; }
|
||||
// Following method clears the config and increases its timestamp, so the deleted
|
||||
// state is considered changed from perspective of the undo/redo stack.
|
||||
void reset() { m_data.clear(); touch(); }
|
||||
|
||||
void assign_config(const ModelConfig &rhs) {
|
||||
if (m_timestamp != rhs.m_timestamp) {
|
||||
@@ -1076,7 +1078,7 @@ public:
|
||||
if (m_timestamp != rhs.m_timestamp) {
|
||||
m_data = std::move(rhs.m_data);
|
||||
m_timestamp = rhs.m_timestamp;
|
||||
rhs.clear();
|
||||
rhs.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user