From 74c6f6ab827aa797a6f2851891b0ab37529e0309 Mon Sep 17 00:00:00 2001 From: Mario Luzeiro Date: Sat, 11 Jul 2020 17:32:45 +0100 Subject: [PATCH] 3D-Viewer: set missing scale and position to the list Fixes https://gitlab.com/kicad/code/kicad/issues/4826 --- .../c3d_render_ogl_legacy.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp index abd818eb87..87c27b7f8a 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp @@ -731,11 +731,6 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( CLAYERS_OGL_DISP_LISTS *pLayerDispList = static_cast(ii->second); set_layer_material( layer_id ); - if( m_ogl_disp_list_through_holes_outer ) - m_ogl_disp_list_through_holes_outer->ApplyScalePosition( - pLayerDispList->GetZBot(), - pLayerDispList->GetZTop() - pLayerDispList->GetZBot() ); - if( (layer_id >= F_Cu) && (layer_id <= B_Cu) ) { if( skipRenderHoles ) @@ -744,6 +739,11 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( } else { + if( m_ogl_disp_list_through_holes_outer ) + m_ogl_disp_list_through_holes_outer->ApplyScalePosition( + pLayerDispList->GetZBot(), + pLayerDispList->GetZTop() - pLayerDispList->GetZBot() ); + if( m_ogl_disp_lists_layers_holes_outer.find( layer_id ) != m_ogl_disp_lists_layers_holes_outer.end() ) { @@ -771,6 +771,11 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( } else { + if( m_ogl_disp_list_through_holes_vias_outer ) + m_ogl_disp_list_through_holes_vias_outer->ApplyScalePosition( + pLayerDispList->GetZBot(), + pLayerDispList->GetZTop() - pLayerDispList->GetZBot() ); + if( (!skipRenderHoles) && m_boardAdapter.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) && ( ( ( layer_id == B_SilkS ) &&