Skip to content

Commit

Permalink
FIX:open cut gizmo check selection.is_empty() again
Browse files Browse the repository at this point in the history
jira: STUDIO-8310
Change-Id: I5265ccb54345595fefb9a3775f45e96be55cc9dd
  • Loading branch information
Haidiye00 authored and lanewei120 committed Oct 15, 2024
1 parent 9e313d5 commit 0faf8d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ void GLGizmoAdvancedCut::on_set_state()

// Reset m_cut_z on gizmo activation
if (get_state() == On) {
const Selection &selection = m_parent.get_selection();
if (selection.is_empty()) {//check selection again
close();
return;
}
m_hover_id = -1;
m_connectors_editing = false;

Expand Down Expand Up @@ -515,6 +520,13 @@ void GLGizmoAdvancedCut::on_set_state()
}
}

void GLGizmoAdvancedCut::close()
{//close gizmo == open it again
auto &mng = m_parent.get_gizmos_manager();
if (mng.get_current_type() == GLGizmosManager::Cut)
mng.open_gizmo(GLGizmosManager::Cut);
}

bool GLGizmoAdvancedCut::on_is_activable() const
{
const Selection &selection = m_parent.get_selection();
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ class GLGizmoAdvancedCut : public GLGizmoRotate3D
virtual std::string on_get_name() const;
virtual std::string on_get_name_str() override { return "Cut"; }
virtual void on_set_state();
void close();
virtual bool on_is_activable() const;
virtual CommonGizmosDataID on_get_requirements() const override;
virtual void on_start_dragging() override;
Expand Down

0 comments on commit 0faf8d5

Please sign in to comment.