From 09d0f6e17c9f1ec98583ecbfed34303a9bb9706a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 21 Jan 2022 23:23:57 +0000 Subject: [PATCH] Map zone layers before checking their visibility. Fixes https://gitlab.com/kicad/code/kicad/issues/10509 --- common/draw_panel_gal.cpp | 6 ++++-- common/view/view_group.cpp | 4 ++++ pcbnew/pcb_painter.cpp | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 50147d4e3b..7ea0a5ab9c 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -251,9 +251,11 @@ void EDA_DRAW_PANEL_GAL::DoRePaint() if( m_view->IsDirty() ) { - if( m_backend != GAL_TYPE_OPENGL && // Already called in opengl - m_view->IsTargetDirty( KIGFX::TARGET_NONCACHED ) ) + if( m_backend != GAL_TYPE_OPENGL // Already called in opengl + && m_view->IsTargetDirty( KIGFX::TARGET_NONCACHED ) ) + { m_gal->ClearScreen(); + } m_view->ClearTargets(); diff --git a/common/view/view_group.cpp b/common/view/view_group.cpp index 1c6a2ec8e9..7bf64f99fa 100644 --- a/common/view/view_group.cpp +++ b/common/view/view_group.cpp @@ -147,6 +147,10 @@ void VIEW_GROUP::ViewDraw( int aLayer, VIEW* aView ) const for( int i = 0; i < layers_count; i++ ) { int layer = layers[i]; + + if( IsZoneLayer( layer ) ) + layer = layer - LAYER_ZONE_START; + bool draw = aView->IsLayerVisible( layer ); if( isSelection ) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 5595567581..b146668324 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1767,10 +1767,10 @@ void PCB_PAINTER::draw( const ZONE* aZone, int aLayer ) // Draw each contour (main contour and holes) - /* This line: + /* * m_gal->DrawPolygon( *outline ); - * should be enough, but currently does not work to draw holes contours in a complex polygon - * so each contour is draw as a simple polygon + * should be enough, but currently does not work to draw holes contours in a complex + * polygon so each contour is draw as a simple polygon */ // Draw the main contour