From b7447ff05e8817bd764fae4f5c8c3e28e23e6bd9 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 8 Jul 2013 15:24:44 +0200 Subject: [PATCH] Remove updating of non-cached layers. --- common/view/view.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/common/view/view.cpp b/common/view/view.cpp index cf8678a254..7528009d6c 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -314,9 +314,9 @@ struct VIEW::updateItemsColor // Obtain the color that should be used for coloring the item const COLOR4D color = painter->GetColor( aItem, layer ); int group = aItem->getGroup( layer ); - wxASSERT( group >= 0 ); - gal->ChangeGroupColor( group, color ); + if( group > 0) + gal->ChangeGroupColor( group, color ); } int layer; @@ -327,6 +327,10 @@ struct VIEW::updateItemsColor void VIEW::UpdateLayerColor( int aLayer ) { + // There is no point in updating non-cached layers + if( !m_layers[aLayer].cached ) + return; + BOX2I r; r.SetMaximum(); @@ -345,8 +349,12 @@ void VIEW::UpdateAllLayersColor() for( LayerMapIter i = m_layers.begin(); i != m_layers.end(); ++i ) { VIEW_LAYER* l = &( ( *i ).second ); - updateItemsColor visitor( l->id, m_painter, m_gal ); + // There is no point in updating non-cached layers + if( !m_layers[l->id].cached ) + continue; + + updateItemsColor visitor( l->id, m_painter, m_gal ); l->items->Query( r, visitor ); } } @@ -374,6 +382,10 @@ struct VIEW::changeItemsDepth void VIEW::ChangeLayerDepth( int aLayer, int aDepth ) { + // There is no point in updating non-cached layers + if( !m_layers[aLayer].cached ) + return; + BOX2I r; r.SetMaximum();