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
if( m_boardAdapter.m_Cfg->m_Render.clip_silk_on_via_annulus
&& m_boardAdapter.m_Cfg->m_Render.realistic && m_boardAdapter.m_Cfg->m_Render.realistic
&& ( layer_id == B_SilkS || layer_id == F_SilkS ) ? m_outerThroughHoleRings && ( layer_id == B_SilkS || layer_id == F_SilkS ) )
: m_outerThroughHoles; {
throughHolesOuter = m_outerThroughHoleRings;
}
if( throughHolesOuter ) if( throughHolesOuter )
{ {
@ -824,8 +827,17 @@ 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 {
// Do not render Paste layers when skipRenderHoles is enabled
// otherwise it will cause z-fight issues
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 && m_boardAdapter.m_Cfg->m_Render.realistic
&& ( ( layer_id == B_SilkS && m_layers.find( B_Mask ) != m_layers.end() ) && ( ( layer_id == B_SilkS && m_layers.find( B_Mask ) != m_layers.end() )
|| ( layer_id == F_SilkS && m_layers.find( F_Mask ) != m_layers.end() ) ) ) || ( layer_id == F_SilkS && m_layers.find( F_Mask ) != m_layers.end() ) ) )
@ -838,27 +850,18 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
pLayerDispListMask, pLayerDispListMask,
throughHolesOuter, anti_board ); throughHolesOuter, anti_board );
} }
else else if( throughHolesOuter )
{
if( !skipRenderHoles && throughHolesOuter
&& ( layer_id == B_SilkS || layer_id == F_SilkS ) )
{ {
pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments, nullptr, pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments, nullptr,
throughHolesOuter, throughHolesOuter,
anti_board ); anti_board );
} }
else 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, pLayerDispList->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
anti_board ); anti_board );
} }
} }
}
}
glPopMatrix(); glPopMatrix();
} }