From e2408989a4fdcc068e030c5967c910679adfca24 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 26 Feb 2018 20:49:42 -0500 Subject: [PATCH] GerbView: redraw negative items when visibility changes --- gerbview/gerbview_frame.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 99bc247879..f73e2afd2f 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -498,8 +498,20 @@ void GERBVIEW_FRAME::SetElementVisibility( GERBVIEW_LAYER_ID aItemIdVisible, break; case LAYER_NEGATIVE_OBJECTS: + { m_DisplayOptions.m_DisplayNegativeObjects = aNewState; + + auto view = GetGalCanvas()->GetView(); + + view->UpdateAllItemsConditionally( KIGFX::REPAINT, + []( KIGFX::VIEW_ITEM* aItem ) { + auto item = static_cast( aItem ); + + // GetLayerPolarity() returns true for negative items + return item->GetLayerPolarity(); + } ); break; + } case LAYER_GERBVIEW_GRID: SetGridVisibility( aNewState );