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

This commit is contained in:
Jon Evans
2018-02-25 18:20:34 -05:00
committed by Wayne Stambaugh
parent be8bb24390
commit d7bb83ddcb
3 changed files with 3 additions and 2 deletions
+1 -1
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 );
+1 -1
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 );
+1
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
};