mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-18 22:31:13 -06:00
Separate GizmoManager on_move into gizmo itself
(cherry picked from commit prusa3d/PrusaSlicer@c751d6327d)
This commit is contained in:
parent
005b83912d
commit
30af274d44
24 changed files with 559 additions and 533 deletions
|
@ -84,6 +84,27 @@ bool GLGizmoMeshBoolean::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GLGizmoMeshBoolean::on_mouse(const wxMouseEvent &mouse_event)
|
||||
{
|
||||
// wxCoord == int --> wx/types.h
|
||||
Vec2i mouse_coord(mouse_event.GetX(), mouse_event.GetY());
|
||||
Vec2d mouse_pos = mouse_coord.cast<double>();
|
||||
|
||||
// when control is down we allow scene pan and rotation even when clicking
|
||||
// over some object
|
||||
bool control_down = mouse_event.CmdDown();
|
||||
bool grabber_contains_mouse = (get_hover_id() != -1);
|
||||
if (mouse_event.LeftDown()) {
|
||||
if ((!control_down || grabber_contains_mouse) &&
|
||||
gizmo_event(SLAGizmoEventType::LeftDown, mouse_pos, mouse_event.ShiftDown(), mouse_event.AltDown(), false))
|
||||
// the gizmo got the event and took some action, there is no need
|
||||
// to do anything more
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GLGizmoMeshBoolean::on_init()
|
||||
{
|
||||
m_shortcut_key = WXK_CONTROL_B;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue