Handle degenerate arcs

Arcs with their centers too far away are effectively straight lines, so
draw them as such

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18170
This commit is contained in:
Seth Hillbrand 2024-06-07 11:27:44 -07:00
parent d7b743a896
commit ff188450e6
1 changed files with 8 additions and 0 deletions

View File

@ -843,6 +843,14 @@ void PCB_PAINTER::draw( const PCB_ARC* aArc, int aLayer )
EDA_ANGLE start_angle = aArc->GetArcAngleStart();
EDA_ANGLE angle = aArc->GetAngle();
if( std::abs( center.x ) > std::numeric_limits<int>::max() / 2
|| std::abs( center.y ) > std::numeric_limits<int>::max() / 2 )
{
const PCB_TRACK* track = static_cast<const PCB_TRACK*>( aArc );
draw( track, aLayer );
return;
}
if( IsNetnameLayer( aLayer ) )
{
// Ummm, yeah. Anyone fancy implementing text on a path?