GerbView: redraw negative items when visibility changes

This commit is contained in:
Jon Evans 2018-02-26 20:49:42 -05:00 committed by jean-pierre charras
parent 37beb726e3
commit e2408989a4
1 changed files with 12 additions and 0 deletions

View File

@ -498,8 +498,20 @@ void GERBVIEW_FRAME::SetElementVisibility( GERBVIEW_LAYER_ID aItemIdVisible,
break; break;
case LAYER_NEGATIVE_OBJECTS: case LAYER_NEGATIVE_OBJECTS:
{
m_DisplayOptions.m_DisplayNegativeObjects = aNewState; m_DisplayOptions.m_DisplayNegativeObjects = aNewState;
auto view = GetGalCanvas()->GetView();
view->UpdateAllItemsConditionally( KIGFX::REPAINT,
[]( KIGFX::VIEW_ITEM* aItem ) {
auto item = static_cast<GERBER_DRAW_ITEM*>( aItem );
// GetLayerPolarity() returns true for negative items
return item->GetLayerPolarity();
} );
break; break;
}
case LAYER_GERBVIEW_GRID: case LAYER_GERBVIEW_GRID:
SetGridVisibility( aNewState ); SetGridVisibility( aNewState );