diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 3609eca76d..52030e7971 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -349,7 +349,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons } else if( IsHoleLayer( originalLayer ) ) { - const VIA* via = static_cast( item ); + const VIA* via = dynamic_cast( item ); VIATYPE viaType = via ? via->GetViaType() : VIATYPE::NOT_DEFINED; if( via && ( viaType == VIATYPE::BLIND_BURIED || viaType == VIATYPE::MICROVIA ) )