mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
FIX: STUDIO-795 crash in painting mode with Ctrl+A
Change-Id: I10e49eb704b4b2bf6b4059242b2cb6374ec91ded (cherry picked from commit 44089d5a783121d1c8c0c98b53f5d78d868567af)
This commit is contained in:
parent
a66aa0a259
commit
db83a1c193
1 changed files with 14 additions and 4 deletions
|
@ -2264,6 +2264,12 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_in_painting_mode = false;
|
||||||
|
GLGizmoPainterBase *current_gizmo_painter = dynamic_cast<GLGizmoPainterBase *>(get_gizmos_manager().get_current());
|
||||||
|
if (current_gizmo_painter != nullptr) {
|
||||||
|
is_in_painting_mode = true;
|
||||||
|
}
|
||||||
|
|
||||||
//BBS: add orient deactivate logic
|
//BBS: add orient deactivate logic
|
||||||
if (keyCode == WXK_ESCAPE
|
if (keyCode == WXK_ESCAPE
|
||||||
&& (_deactivate_arrange_menu() || _deactivate_orient_menu()))
|
&& (_deactivate_arrange_menu() || _deactivate_orient_menu()))
|
||||||
|
@ -2281,6 +2287,7 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
#else /* __APPLE__ */
|
#else /* __APPLE__ */
|
||||||
case WXK_CONTROL_A:
|
case WXK_CONTROL_A:
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
|
if (!is_in_painting_mode)
|
||||||
post_event(SimpleEvent(EVT_GLCANVAS_SELECT_ALL));
|
post_event(SimpleEvent(EVT_GLCANVAS_SELECT_ALL));
|
||||||
break;
|
break;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@ -2289,6 +2296,7 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
#else /* __APPLE__ */
|
#else /* __APPLE__ */
|
||||||
case WXK_CONTROL_C:
|
case WXK_CONTROL_C:
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
|
if (!is_in_painting_mode)
|
||||||
post_event(SimpleEvent(EVT_GLTOOLBAR_COPY));
|
post_event(SimpleEvent(EVT_GLTOOLBAR_COPY));
|
||||||
break;
|
break;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@ -2325,6 +2333,7 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
#else /* __APPLE__ */
|
#else /* __APPLE__ */
|
||||||
case WXK_CONTROL_V:
|
case WXK_CONTROL_V:
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
|
if (!is_in_painting_mode)
|
||||||
post_event(SimpleEvent(EVT_GLTOOLBAR_PASTE));
|
post_event(SimpleEvent(EVT_GLTOOLBAR_PASTE));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2334,6 +2343,7 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||||
#else /* __APPLE__ */
|
#else /* __APPLE__ */
|
||||||
case WXK_CONTROL_X:
|
case WXK_CONTROL_X:
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
|
if (!is_in_painting_mode)
|
||||||
post_event(SimpleEvent(EVT_GLTOOLBAR_CUT));
|
post_event(SimpleEvent(EVT_GLTOOLBAR_CUT));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue