ENABLE_GCODE_VIEWER_AS_STATE -> Smoother transition between states

This commit is contained in:
enricoturri1966 2020-06-08 14:37:40 +02:00
parent ea0e9a5873
commit 9f94f89808

View file

@ -1163,6 +1163,8 @@ void MainFrame::set_mode(EMode mode)
{
m_plater->reset();
m_plater->Freeze();
// switch view
m_plater->select_view_3D("3D");
m_plater->select_view("iso");
@ -1187,6 +1189,8 @@ void MainFrame::set_mode(EMode mode)
m_restore_from_gcode_viewer.collapsed_sidebar = false;
}
m_plater->Thaw();
break;
}
case EMode::GCodeViewer:
@ -1194,6 +1198,8 @@ void MainFrame::set_mode(EMode mode)
m_plater->reset();
m_plater->reset_last_loaded_gcode();
m_plater->Freeze();
// reinitialize undo/redo stack
m_plater->clear_undo_redo_stack_main();
m_plater->take_snapshot(_L("New Project"));
@ -1222,6 +1228,8 @@ void MainFrame::set_mode(EMode mode)
m_restore_from_gcode_viewer.collapsed_sidebar = true;
}
m_plater->Thaw();
break;
}
}