From d7bb83ddcbbe947e7d1657d09cde5df8fbfe7f4f Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 25 Feb 2018 15:01:17 -0500 Subject: [PATCH] Add a REPAINT flag for faster redraw when bounding box hasn't changed --- common/view/view.cpp | 2 +- gerbview/events_called_functions.cpp | 2 +- include/view/view_item.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/view/view.cpp b/common/view/view.cpp index b2d5a87e10..b3c37afdd2 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -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 ); diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index bca5f36c63..8d5043e97f 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -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 ); diff --git a/include/view/view_item.h b/include/view/view_item.h index 8c1825caa5..67d6dad743 100644 --- a/include/view/view_item.h +++ b/include/view/view_item.h @@ -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 };