3d-viewer: Check for at least 3 segments in circle

Fixes: lp:1792173
* https://bugs.launchpad.net/kicad/+bug/1792173
This commit is contained in:
Seth Hillbrand 2018-09-12 09:19:35 -07:00 committed by Jeff Young
parent a46133d64b
commit c1c89d13ff
1 changed files with 2 additions and 1 deletions

View File

@ -256,7 +256,8 @@ unsigned int CINFO3D_VISU::GetNrSegmentsCircle( int aDiameterBIU ) const
{
wxASSERT( aDiameterBIU > 0 );
return GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, 360.0 );
// Require at least 3 segments for a circle
return std::max( GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, 360.0 ), 3 );
}