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:
Lukas Matena 2021-08-30 17:23:44 +02:00
parent 9a5f61c306
commit 270c076e77
6 changed files with 22 additions and 20 deletions

View file

@ -541,7 +541,10 @@ public:
indexed_triangle_set get_facets_strict(const ModelVolume& mv, EnforcerBlockerType type) const;
bool has_facets(const ModelVolume& mv, EnforcerBlockerType type) const;
bool empty() const { return m_data.first.empty(); }
void clear();
// 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();
// Serialize triangle into string, for serialization into 3MF/AMF.
std::string get_triangle_as_string(int i) const;