Trim solder paste (and other layers) to holes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8484

(cherry picked from commit b53bc1ae38)
This commit is contained in:
Jeff Young 2023-05-30 00:01:13 +01:00
parent 0bd45f691e
commit e5ef973d52
1 changed files with 30 additions and 27 deletions

View File

@ -802,11 +802,14 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
{ {
setLayerMaterial( layer_id ); setLayerMaterial( layer_id );
OPENGL_RENDER_LIST* throughHolesOuter = OPENGL_RENDER_LIST* throughHolesOuter = m_outerThroughHoles;
m_boardAdapter.m_Cfg->m_Render.clip_silk_on_via_annulus
&& m_boardAdapter.m_Cfg->m_Render.realistic if( m_boardAdapter.m_Cfg->m_Render.clip_silk_on_via_annulus
&& ( layer_id == B_SilkS || layer_id == F_SilkS ) ? m_outerThroughHoleRings && m_boardAdapter.m_Cfg->m_Render.realistic
: m_outerThroughHoles; && ( layer_id == B_SilkS || layer_id == F_SilkS ) )
{
throughHolesOuter = m_outerThroughHoleRings;
}
if( throughHolesOuter ) if( throughHolesOuter )
{ {
@ -824,11 +827,20 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
- pLayerDispList->GetZBot() ); - pLayerDispList->GetZBot() );
} }
if( !skipRenderHoles if( skipRenderHoles )
&& m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk {
&& m_boardAdapter.m_Cfg->m_Render.realistic // Do not render Paste layers when skipRenderHoles is enabled
&& ( ( layer_id == B_SilkS && m_layers.find( B_Mask ) != m_layers.end() ) // otherwise it will cause z-fight issues
|| ( layer_id == F_SilkS && m_layers.find( F_Mask ) != m_layers.end() ) ) ) if( layer_id != B_Paste && layer_id != F_Paste )
{
pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
anti_board );
}
}
else if( m_boardAdapter.m_Cfg->m_Render.subtract_mask_from_silk
&& m_boardAdapter.m_Cfg->m_Render.realistic
&& ( ( layer_id == B_SilkS && m_layers.find( B_Mask ) != m_layers.end() )
|| ( layer_id == F_SilkS && m_layers.find( F_Mask ) != m_layers.end() ) ) )
{ {
const PCB_LAYER_ID layerMask_id = (layer_id == B_SilkS) ? B_Mask : F_Mask; const PCB_LAYER_ID layerMask_id = (layer_id == B_SilkS) ? B_Mask : F_Mask;
@ -838,25 +850,16 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
pLayerDispListMask, pLayerDispListMask,
throughHolesOuter, anti_board ); throughHolesOuter, anti_board );
} }
else if( throughHolesOuter )
{
pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments, nullptr,
throughHolesOuter,
anti_board );
}
else else
{ {
if( !skipRenderHoles && throughHolesOuter pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
&& ( layer_id == B_SilkS || layer_id == F_SilkS ) ) anti_board );
{
pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments, nullptr,
throughHolesOuter,
anti_board );
}
else
{
// Do not render Paste layers when skipRenderHoles is enabled
// otherwise it will cause z-fight issues
if( !( skipRenderHoles && ( layer_id == B_Paste || layer_id == F_Paste ) ) )
{
pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
anti_board );
}
}
} }
} }