mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-06-01 12:39:38 -07:00
Update object list after undo/redo
This commit is contained in:
@@ -566,10 +566,8 @@ void StackImpl::take_snapshot(const std::string &snapshot_name, const Slic3r::Mo
|
||||
m_selection.volumes_and_instances.clear();
|
||||
m_selection.volumes_and_instances.reserve(selection.get_volume_idxs().size());
|
||||
m_selection.mode = selection.get_mode();
|
||||
for (unsigned int volume_idx : selection.get_volume_idxs()) {
|
||||
const Slic3r::GLVolume::CompositeID &id = selection.get_volume(volume_idx)->composite_id;
|
||||
m_selection.volumes_and_instances.emplace_back(id.volume_id, id.instance_id);
|
||||
}
|
||||
for (unsigned int volume_idx : selection.get_volume_idxs())
|
||||
m_selection.volumes_and_instances.emplace_back(selection.get_volume(volume_idx)->geometry_id);
|
||||
this->save_mutable_object<Selection, Selection>(m_selection);
|
||||
// Save the snapshot info.
|
||||
m_active_snapshot_time = m_current_time ++;
|
||||
|
||||
@@ -31,8 +31,8 @@ struct Snapshot
|
||||
|
||||
// Excerpt of Slic3r::GUI::Selection for serialization onto the Undo / Redo stack.
|
||||
struct Selection : public Slic3r::ObjectBase {
|
||||
unsigned char mode;
|
||||
std::vector<std::pair<ObjectID, ObjectID>> volumes_and_instances;
|
||||
unsigned char mode;
|
||||
std::vector<std::pair<size_t, size_t>> volumes_and_instances;
|
||||
template<class Archive> void serialize(Archive &ar) { ar(mode, volumes_and_instances); }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user