mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Recalculate SLA supports after undo/redo in case SLA gizmo was active and had supports when the snapshot was taken
This commit is contained in:
parent
b55a140ad4
commit
52933d1bab
6 changed files with 72 additions and 18 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "slic3r/GUI/GUI_ObjectManipulation.hpp"
|
||||
#include "slic3r/GUI/PresetBundle.hpp"
|
||||
#include "slic3r/Utils/UndoRedo.hpp"
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <wx/glcanvas.h>
|
||||
|
@ -464,6 +465,11 @@ ClippingPlane GLGizmosManager::get_sla_clipping_plane() const
|
|||
return ClippingPlane::ClipsNothing();
|
||||
}
|
||||
|
||||
bool GLGizmosManager::wants_reslice_supports_on_undo() const
|
||||
{
|
||||
return (m_current == SlaSupports
|
||||
&& dynamic_cast<const GLGizmoSlaSupports*>(m_gizmos.at(SlaSupports))->has_backend_supports());
|
||||
}
|
||||
|
||||
void GLGizmosManager::render_current_gizmo() const
|
||||
{
|
||||
|
@ -870,10 +876,13 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
|||
return processed;
|
||||
}
|
||||
|
||||
void GLGizmosManager::update_after_undo_redo()
|
||||
void GLGizmosManager::update_after_undo_redo(const UndoRedo::Snapshot& snapshot)
|
||||
{
|
||||
update_data();
|
||||
m_serializing = false;
|
||||
if (m_current == SlaSupports
|
||||
&& snapshot.snapshot_data.flags & UndoRedo::SnapshotData::RECALCULATE_SLA_SUPPORTS)
|
||||
dynamic_cast<GLGizmoSlaSupports*>(m_gizmos[SlaSupports])->reslice_SLA_supports();
|
||||
}
|
||||
|
||||
void GLGizmosManager::reset()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue