Fixed a bug with invisible vias
If there was a board with no copper layers checked as visible, the initial GAL cache contained an empty entry for them. In such case, toggling layers visibility have not changed anything. The visibility condition check has been moved to ViewGetLOD() method which serves better the purpose of dynamic visibility checks. Fixes: lp:1639974 * https://bugs.launchpad.net/kicad/+bug/1639974
This commit is contained in:
parent
217593f6bc
commit
e53c3afc29
|
@ -1018,6 +1018,18 @@ void VIA::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||||
|
{
|
||||||
|
BOARD* board = GetBoard();
|
||||||
|
|
||||||
|
// Only draw the via if at least one of the layers it crosses is being displayed
|
||||||
|
if( board && ( board->GetVisibleLayers() & GetLayerSet() ).any() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return std::numeric_limits<unsigned int>::max();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// see class_track.h
|
// see class_track.h
|
||||||
void TRACK::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
void TRACK::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||||
{
|
{
|
||||||
|
|
|
@ -434,6 +434,9 @@ public:
|
||||||
/// @copydoc VIEW_ITEM::ViewGetLayers()
|
/// @copydoc VIEW_ITEM::ViewGetLayers()
|
||||||
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||||
|
|
||||||
|
/// @copydoc VIEW_ITEM::ViewGetLOD()
|
||||||
|
virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
|
||||||
|
|
||||||
virtual void Flip( const wxPoint& aCentre ) override;
|
virtual void Flip( const wxPoint& aCentre ) override;
|
||||||
|
|
||||||
#if defined (DEBUG)
|
#if defined (DEBUG)
|
||||||
|
|
|
@ -393,11 +393,6 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer )
|
||||||
VECTOR2D center( aVia->GetStart() );
|
VECTOR2D center( aVia->GetStart() );
|
||||||
double radius = 0.0;
|
double radius = 0.0;
|
||||||
|
|
||||||
// Only draw the via if at least one of the layers it crosses is being displayed
|
|
||||||
BOARD* brd = aVia->GetBoard( );
|
|
||||||
if( !( brd->GetVisibleLayers() & aVia->GetLayerSet() ).any() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Choose drawing settings depending on if we are drawing via's pad or hole
|
// Choose drawing settings depending on if we are drawing via's pad or hole
|
||||||
if( aLayer == LAYER_VIAS_HOLES )
|
if( aLayer == LAYER_VIAS_HOLES )
|
||||||
radius = aVia->GetDrillValue() / 2.0;
|
radius = aVia->GetDrillValue() / 2.0;
|
||||||
|
|
Loading…
Reference in New Issue