SLA gizmo now allows to deselect a point
This commit is contained in:
parent
7d488e3424
commit
69027b53fd
2 changed files with 20 additions and 2 deletions
|
@ -330,8 +330,12 @@ bool GLGizmoSlaSupports::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
|||
m_canvas_width = m_parent.get_canvas_size().get_width();
|
||||
m_canvas_height = m_parent.get_canvas_size().get_height();
|
||||
}
|
||||
else
|
||||
select_point(m_hover_id);
|
||||
else {
|
||||
if (m_editing_mode_cache[m_hover_id].selected)
|
||||
unselect_point(m_hover_id);
|
||||
else
|
||||
select_point(m_hover_id);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -791,6 +795,19 @@ void GLGizmoSlaSupports::select_point(int i)
|
|||
}
|
||||
|
||||
|
||||
void GLGizmoSlaSupports::unselect_point(int i)
|
||||
{
|
||||
m_editing_mode_cache[i].selected = false;
|
||||
m_selection_empty = true;
|
||||
for (const CacheEntry& ce : m_editing_mode_cache) {
|
||||
if (ce.selected) {
|
||||
m_selection_empty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GLGizmoSlaSupports::editing_mode_discard_changes()
|
||||
{
|
||||
|
|
|
@ -93,6 +93,7 @@ private:
|
|||
NoPoints,
|
||||
};
|
||||
void select_point(int i);
|
||||
void unselect_point(int i);
|
||||
void editing_mode_apply_changes();
|
||||
void editing_mode_discard_changes();
|
||||
void editing_mode_reload_cache();
|
||||
|
|
Loading…
Reference in a new issue