gerbview: Don't use worksheet items as GERBER_DRAW items

The static cast caught items that don't have the GetLayerPolarity
function (worksheet view)
This commit is contained in:
Seth Hillbrand 2019-08-05 20:00:36 -07:00
parent 4399a52ad3
commit 50b7027b22
1 changed files with 2 additions and 2 deletions

View File

@ -443,10 +443,10 @@ void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
view->UpdateAllItemsConditionally( KIGFX::REPAINT, []( KIGFX::VIEW_ITEM* aItem )
{
auto item = static_cast<GERBER_DRAW_ITEM*>( aItem );
auto item = dynamic_cast<GERBER_DRAW_ITEM*>( aItem );
// GetLayerPolarity() returns true for negative items
return item->GetLayerPolarity();
return ( item && item->GetLayerPolarity() );
} );
break;
}