From ff188450e618755e7d5f7de34b6e7e1c2533def3 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 7 Jun 2024 11:27:44 -0700 Subject: [PATCH] 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 --- pcbnew/pcb_painter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index eac8ab5622..20f886096f 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -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::max() / 2 + || std::abs( center.y ) > std::numeric_limits::max() / 2 ) + { + const PCB_TRACK* track = static_cast( aArc ); + draw( track, aLayer ); + return; + } + if( IsNetnameLayer( aLayer ) ) { // Ummm, yeah. Anyone fancy implementing text on a path?