From 11586863cf11460cb1801dc29e46d5562fefbab7 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 18 May 2024 17:12:34 +0000 Subject: [PATCH] Fix broken hit test for arcs in via placer Fixes https://gitlab.com/kicad/code/kicad/-/issues/17844 (cherry picked from commit aaf3142e9aee3e820b5ba4a4a2d3d89ab4a6b8d8) Co-authored-by: Jon Evans --- pcbnew/tools/drawing_tool.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index cdea76327e..a827c9e6d9 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2848,7 +2848,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent ) if( !( item->GetLayerSet() & lset ).any() ) continue; - if( item->Type() == PCB_TRACE_T || item->Type() == PCB_ARC_T ) + if( item->Type() == PCB_TRACE_T ) { PCB_TRACK* track = static_cast( item ); @@ -2858,6 +2858,13 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent ) possible_tracks.push_back( track ); } } + else if( item->Type() == PCB_ARC_T ) + { + PCB_ARC* arc = static_cast( item ); + + if( arc->HitTest( position, aVia->GetWidth() / 2 ) ) + possible_tracks.push_back( arc ); + } } PCB_TRACK* return_track = nullptr;