From d26b59a0bf699a60e2f37f0be6c3e725b02a3a42 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 7 Oct 2022 06:50:50 +0300 Subject: [PATCH] Improve arc construction using angles from arc geometry manager. Fixes https://gitlab.com/kicad/code/kicad/issues/11713 --- pcbnew/tools/drawing_tool.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 3ececdb85f..91c4999d5a 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2136,10 +2136,20 @@ static void updateArcFromConstructionMgr( const KIGFX::PREVIEW::ARC_GEOM_MANAGER aArc.SetCenter( vec ); - vec = aMgr.GetStartRadiusEnd(); - aArc.SetStart( vec ); - vec = aMgr.GetEndRadiusEnd(); - aArc.SetEnd( vec ); + if( aMgr.GetSubtended() < ANGLE_0 ) + { + vec = aMgr.GetStartRadiusEnd(); + aArc.SetStart( vec ); + vec = aMgr.GetEndRadiusEnd(); + aArc.SetEnd( vec ); + } + else + { + vec = aMgr.GetEndRadiusEnd(); + aArc.SetStart( vec ); + vec = aMgr.GetStartRadiusEnd(); + aArc.SetEnd( vec ); + } }