3D-Viewer: do not use selection while on preview

This commit is contained in:
Mario Luzeiro 2020-09-27 18:18:44 +01:00 committed by Jon Evans
parent 6db0c58e8f
commit ec3c20bf84
4 changed files with 11 additions and 2 deletions

View File

@ -90,6 +90,8 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE*
loadCommonSettings();
m_boardAdapter.SetFlag( FL_USE_SELECTION, false );
// Create the manager
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( m_dummyBoard, nullptr, nullptr, nullptr, this );

View File

@ -110,6 +110,8 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
SetFlag( FL_RENDER_OPENGL_VIAS_DISABLE_ON_MOVE, false );
SetFlag( FL_RENDER_OPENGL_HOLES_DISABLE_ON_MOVE, false );
SetFlag( FL_USE_SELECTION, true );
m_BgColorBot = SFVEC4F( 0.4, 0.4, 0.5, 1.0 );
m_BgColorTop = SFVEC4F( 0.8, 0.8, 0.9, 1.0 );
m_BoardBodyColor = SFVEC4F( 0.4, 0.4, 0.5, 0.9 );

View File

@ -46,6 +46,8 @@ enum DISPLAY3D_FLG
FL_MODULE_ATTRIBUTES_NORMAL_INSERT,
FL_MODULE_ATTRIBUTES_VIRTUAL,
FL_USE_SELECTION,
FL_SHOW_BOARD_BODY,
FL_MOUSEWHEEL_PANNING,
FL_USE_REALISTIC_MODE,

View File

@ -1246,7 +1246,8 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot, boo
{
const bool isIntersected = ( module == m_currentIntersectedBoardItem );
if( !isIntersected &&
if( m_boardAdapter.GetFlag( FL_USE_SELECTION ) &&
!isIntersected &&
( ( aRenderSelectedOnly && !module->IsSelected() ) ||
( !aRenderSelectedOnly && module->IsSelected() ) ) )
continue;
@ -1280,7 +1281,9 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot, boo
void C3D_RENDER_OGL_LEGACY::render_3D_models( bool aRenderTopOrBot,
bool aRenderTransparentOnly )
{
render_3D_models_selected( aRenderTopOrBot, aRenderTransparentOnly, true );
if( m_boardAdapter.GetFlag( FL_USE_SELECTION ) )
render_3D_models_selected( aRenderTopOrBot, aRenderTransparentOnly, true );
render_3D_models_selected( aRenderTopOrBot, aRenderTransparentOnly, false );
}