diff --git a/include/view/view.h b/include/view/view.h index 844f72bd2c..9ab7fe9a6a 100644 --- a/include/view/view.h +++ b/include/view/view.h @@ -292,6 +292,8 @@ public: */ inline void SetLayerVisible( int aLayer, bool aVisible = true ) { + wxASSERT( aLayer < (int) m_layers.size() ); + if( m_layers[aLayer].visible != aVisible ) { // Target has to be redrawn after changing its visibility @@ -307,9 +309,18 @@ public: */ inline bool IsLayerVisible( int aLayer ) const { + wxASSERT( aLayer < (int) m_layers.size() ); + return m_layers.at( aLayer ).visible; } + inline void SetLayerDisplayOnly( int aLayer, bool aDisplayOnly = true ) + { + wxASSERT( aLayer < (int) m_layers.size() ); + + m_layers[aLayer].displayOnly = aDisplayOnly; + } + /** * Function SetLayerTarget() * Changes the rendering target for a particular layer. @@ -318,6 +329,8 @@ public: */ inline void SetLayerTarget( int aLayer, RENDER_TARGET aTarget ) { + wxASSERT( aLayer < (int) m_layers.size() ); + m_layers[aLayer].target = aTarget; } @@ -477,6 +490,8 @@ public: /// Returns true if the layer is cached inline bool IsCached( int aLayer ) const { + wxASSERT( aLayer < (int) m_layers.size() ); + return m_layers.at( aLayer ).target == TARGET_CACHED; } diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 3e05f6af1b..15c6a92b99 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -123,10 +123,12 @@ EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aGalType ) // Netnames are drawn only when scale is sufficient (level of details) // so there is no point in caching them m_view->SetLayerTarget( layer, KIGFX::TARGET_NONCACHED ); + m_view->SetLayerDisplayOnly( layer ); } } m_view->SetLayerTarget( ITEM_GAL_LAYER( ANCHOR_VISIBLE ), KIGFX::TARGET_NONCACHED ); + m_view->SetLayerDisplayOnly( ITEM_GAL_LAYER( ANCHOR_VISIBLE ) ); // Some more required layers settings m_view->SetRequired( ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( VIA_THROUGH_VISIBLE ) ); @@ -147,7 +149,13 @@ EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aGalType ) m_view->SetRequired( ITEM_GAL_LAYER( PAD_BK_VISIBLE ), ITEM_GAL_LAYER( MOD_BK_VISIBLE ) ); m_view->SetLayerTarget( ITEM_GAL_LAYER( GP_OVERLAY ), KIGFX::TARGET_OVERLAY ); + m_view->SetLayerDisplayOnly( ITEM_GAL_LAYER( GP_OVERLAY ) ); m_view->SetLayerTarget( ITEM_GAL_LAYER( RATSNEST_VISIBLE ), KIGFX::TARGET_OVERLAY ); + m_view->SetLayerDisplayOnly( ITEM_GAL_LAYER( RATSNEST_VISIBLE ) ); + + m_view->SetLayerDisplayOnly( ITEM_GAL_LAYER( WORKSHEET ) ); + m_view->SetLayerDisplayOnly( ITEM_GAL_LAYER( GRID_VISIBLE ) ); + m_view->SetLayerDisplayOnly( ITEM_GAL_LAYER( DRC_VISIBLE ) ); // Load display options (such as filled/outline display of items). // Can be made only if the parent windos is a EDA_DRAW_FRAME (or a derived class)