3Dviewer: fix incorrect drawing of a 3d model hovered by the mouse pointer.

Was due to a recent change in 3D code.
This commit is contained in:
jean-pierre charras 2021-05-22 20:23:43 +02:00
parent be436ec977
commit a06f965ffa
1 changed files with 5 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt> * Copyright (C) 2015-2020 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -1179,19 +1179,18 @@ void RENDER_3D_LEGACY::render3dModelsSelected( bool aRenderTopOrBot, bool aRende
// Go for all footprints // Go for all footprints
for( FOOTPRINT* fp : m_boardAdapter.GetBoard()->Footprints() ) for( FOOTPRINT* fp : m_boardAdapter.GetBoard()->Footprints() )
{ {
const bool isIntersected = fp == m_currentRollOverItem;
bool highlight = false; bool highlight = false;
if( m_boardAdapter.GetFlag( FL_USE_SELECTION ) ) if( m_boardAdapter.GetFlag( FL_USE_SELECTION ) )
{ {
if( fp == m_currentRollOverItem ) if( isIntersected )
{ {
if( aRenderSelectedOnly ) if( aRenderSelectedOnly )
highlight = m_boardAdapter.GetFlag( FL_HIGHLIGHT_ROLLOVER_ITEM ); highlight = m_boardAdapter.GetFlag( FL_HIGHLIGHT_ROLLOVER_ITEM );
else if( !fp->IsSelected() )
continue;
} }
else if( ( aRenderSelectedOnly && !fp->IsSelected() ) else if( ( aRenderSelectedOnly && !fp->IsSelected() )
|| ( !aRenderSelectedOnly && fp->IsSelected() ) ) || ( !aRenderSelectedOnly && fp->IsSelected() ) )
{ {
continue; continue;
} }
@ -1212,7 +1211,7 @@ void RENDER_3D_LEGACY::render3dModelsSelected( bool aRenderTopOrBot, bool aRende
if( ( aRenderTopOrBot && !fp->IsFlipped() ) if( ( aRenderTopOrBot && !fp->IsFlipped() )
|| ( !aRenderTopOrBot && fp->IsFlipped() ) ) || ( !aRenderTopOrBot && fp->IsFlipped() ) )
{ {
renderFootprint( fp, aRenderTransparentOnly, highlight ); renderFootprint( fp, aRenderTransparentOnly, isIntersected );
} }
} }
} }