mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Follow-up of e042cab8fa
-> Avoid polluting undo/redo stack
This commit is contained in:
parent
d320a03c54
commit
3371fa42da
1 changed files with 52 additions and 2 deletions
|
@ -776,6 +776,56 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (m_current == Move)
|
||||||
|
{
|
||||||
|
switch (keyCode)
|
||||||
|
{
|
||||||
|
case WXK_NUMPAD_LEFT: case WXK_LEFT:
|
||||||
|
case WXK_NUMPAD_RIGHT: case WXK_RIGHT:
|
||||||
|
case WXK_NUMPAD_UP: case WXK_UP:
|
||||||
|
case WXK_NUMPAD_DOWN: case WXK_DOWN:
|
||||||
|
{
|
||||||
|
m_parent.do_move(L("Gizmo-Move"));
|
||||||
|
stop_dragging();
|
||||||
|
update_data();
|
||||||
|
|
||||||
|
wxGetApp().obj_manipul()->set_dirty();
|
||||||
|
// Let the plater know that the dragging finished, so a delayed refresh
|
||||||
|
// of the scene with the background processing data should be performed.
|
||||||
|
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
|
||||||
|
// updates camera target constraints
|
||||||
|
m_parent.refresh_camera_scene_box();
|
||||||
|
processed = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: { break; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (m_current == Rotate)
|
||||||
|
{
|
||||||
|
switch (keyCode)
|
||||||
|
{
|
||||||
|
case WXK_NUMPAD_LEFT: case WXK_LEFT:
|
||||||
|
case WXK_NUMPAD_RIGHT: case WXK_RIGHT:
|
||||||
|
{
|
||||||
|
m_parent.do_rotate(L("Gizmo-Rotate"));
|
||||||
|
stop_dragging();
|
||||||
|
update_data();
|
||||||
|
|
||||||
|
wxGetApp().obj_manipul()->set_dirty();
|
||||||
|
// Let the plater know that the dragging finished, so a delayed refresh
|
||||||
|
// of the scene with the background processing data should be performed.
|
||||||
|
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
|
||||||
|
// updates camera target constraints
|
||||||
|
m_parent.refresh_camera_scene_box();
|
||||||
|
processed = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: { break; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if (processed)
|
// if (processed)
|
||||||
// m_parent.set_cursor(GLCanvas3D::Standard);
|
// m_parent.set_cursor(GLCanvas3D::Standard);
|
||||||
|
@ -793,9 +843,9 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
||||||
auto do_move = [this, &processed](const Vec3d& displacement) {
|
auto do_move = [this, &processed](const Vec3d& displacement) {
|
||||||
Selection& selection = m_parent.get_selection();
|
Selection& selection = m_parent.get_selection();
|
||||||
selection.start_dragging();
|
selection.start_dragging();
|
||||||
|
start_dragging();
|
||||||
selection.translate(displacement);
|
selection.translate(displacement);
|
||||||
wxGetApp().obj_manipul()->set_dirty();
|
wxGetApp().obj_manipul()->set_dirty();
|
||||||
m_parent.do_move(L("Gizmo-Move"));
|
|
||||||
processed = true;
|
processed = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -813,9 +863,9 @@ bool GLGizmosManager::on_key(wxKeyEvent& evt)
|
||||||
auto do_rotate = [this, &processed](const Vec3d& rotation) {
|
auto do_rotate = [this, &processed](const Vec3d& rotation) {
|
||||||
Selection& selection = m_parent.get_selection();
|
Selection& selection = m_parent.get_selection();
|
||||||
selection.start_dragging();
|
selection.start_dragging();
|
||||||
|
start_dragging();
|
||||||
selection.rotate(rotation, TransformationType(TransformationType::World_Relative_Joint));
|
selection.rotate(rotation, TransformationType(TransformationType::World_Relative_Joint));
|
||||||
wxGetApp().obj_manipul()->set_dirty();
|
wxGetApp().obj_manipul()->set_dirty();
|
||||||
m_parent.do_rotate(L("Gizmo-Rotate"));
|
|
||||||
processed = true;
|
processed = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue