Add a REPAINT flag for faster redraw when bounding box hasn't changed

This commit is contained in:
Jon Evans 2018-02-25 15:01:17 -05:00 committed by Wayne Stambaugh
parent be8bb24390
commit d7bb83ddcb
3 changed files with 3 additions and 2 deletions

View File

@ -1092,7 +1092,7 @@ void VIEW::invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags )
if( IsCached( layerId ) )
{
if( aUpdateFlags & ( GEOMETRY | LAYERS ) )
if( aUpdateFlags & ( GEOMETRY | LAYERS | REPAINT ) )
updateItemGeometry( aItem, layerId );
else if( aUpdateFlags & COLOR )
updateItemColor( aItem, layerId );

View File

@ -533,7 +533,7 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
auto view = GetGalCanvas()->GetView();
if( needs_repaint )
view->UpdateAllItems( KIGFX::GEOMETRY );
view->UpdateAllItems( KIGFX::REPAINT );
else
view->UpdateAllItems( KIGFX::COLOR );

View File

@ -57,6 +57,7 @@ enum VIEW_UPDATE_FLAGS {
GEOMETRY = 0x04, /// Position or shape has changed
LAYERS = 0x08, /// Layers have changed
INITIAL_ADD = 0x10, /// Item is being added to the view
REPAINT = 0x20, /// Item needs to be redrawn
ALL = 0xef /// All except INITIAL_ADD
};