mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Handling of gizmos related key events moved into new method GLGizmosManager::on_key()
This commit is contained in:
parent
52f11a6f0d
commit
47c39f51e5
3 changed files with 35 additions and 13 deletions
|
@ -660,7 +660,6 @@ bool GLGizmosManager::on_char(wxKeyEvent& evt, GLCanvas3D& canvas)
|
|||
int keyCode = evt.GetKeyCode();
|
||||
int ctrlMask = wxMOD_CONTROL;
|
||||
|
||||
const Selection& selection = canvas.get_selection();
|
||||
bool processed = false;
|
||||
|
||||
if ((evt.GetModifiers() & ctrlMask) != 0)
|
||||
|
@ -732,7 +731,7 @@ bool GLGizmosManager::on_char(wxKeyEvent& evt, GLCanvas3D& canvas)
|
|||
|
||||
if (!processed)
|
||||
{
|
||||
if (handle_shortcut(keyCode, selection))
|
||||
if (handle_shortcut(keyCode, canvas.get_selection()))
|
||||
{
|
||||
canvas.update_gizmos_data();
|
||||
processed = true;
|
||||
|
@ -745,6 +744,24 @@ bool GLGizmosManager::on_char(wxKeyEvent& evt, GLCanvas3D& canvas)
|
|||
return processed;
|
||||
}
|
||||
|
||||
bool GLGizmosManager::on_key(wxKeyEvent& evt, GLCanvas3D& canvas)
|
||||
{
|
||||
const int keyCode = evt.GetKeyCode();
|
||||
bool processed = false;
|
||||
|
||||
if (evt.GetEventType() == wxEVT_KEY_UP)
|
||||
{
|
||||
if ((m_current == SlaSupports) && (keyCode == WXK_SHIFT) && gizmo_event(SLAGizmoEventType::ShiftUp))
|
||||
// shift has been just released - SLA gizmo might want to close rectangular selection.
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (processed)
|
||||
canvas.set_as_dirty();
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
void GLGizmosManager::reset()
|
||||
{
|
||||
for (GizmosMap::value_type& gizmo : m_gizmos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue