mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-26 18:21:18 -06:00
Fixed cut contours in gizmo cut after deleting an object
This commit is contained in:
parent
ad0902e44e
commit
740067c576
3 changed files with 21 additions and 5 deletions
|
|
@ -55,8 +55,15 @@ std::string GLGizmoCut::on_get_name() const
|
|||
void GLGizmoCut::on_set_state()
|
||||
{
|
||||
// Reset m_cut_z on gizmo activation
|
||||
#if ENABLE_SINKING_CONTOURS
|
||||
if (get_state() == On) {
|
||||
m_cut_z = bounding_box().center().z();
|
||||
m_cut_contours.reset();
|
||||
}
|
||||
#else
|
||||
if (get_state() == On)
|
||||
m_cut_z = bounding_box().center().z();
|
||||
#endif // ENABLE_SINKING_CONTOURS
|
||||
}
|
||||
|
||||
bool GLGizmoCut::on_is_activable() const
|
||||
|
|
@ -211,10 +218,9 @@ void GLGizmoCut::on_render_input_window(float x, float y, float bottom_limit)
|
|||
|
||||
if (cut_clicked && (m_keep_upper || m_keep_lower)) {
|
||||
perform_cut(m_parent.get_selection());
|
||||
m_cut_contours.cut_z = 0.0f;
|
||||
m_cut_contours.object_idx = -1;
|
||||
m_cut_contours.instance_idx = -1;
|
||||
m_cut_contours.contours.reset();
|
||||
#if ENABLE_SINKING_CONTOURS
|
||||
m_cut_contours.reset();
|
||||
#endif // ENABLE_SINKING_CONTOURS
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,16 @@ class GLGizmoCut : public GLGizmoBase
|
|||
Vec3d shift{ Vec3d::Zero() };
|
||||
int object_idx{ -1 };
|
||||
int instance_idx{ -1 };
|
||||
|
||||
void reset() {
|
||||
mesh.clear();
|
||||
contours.reset();
|
||||
cut_z = 0.0;
|
||||
position = Vec3d::Zero();
|
||||
shift = Vec3d::Zero();
|
||||
object_idx = -1;
|
||||
instance_idx = -1;
|
||||
}
|
||||
};
|
||||
|
||||
CutContours m_cut_contours;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue