From aaf3142e9aee3e820b5ba4a4a2d3d89ab4a6b8d8 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 18 May 2024 13:12:01 -0400 Subject: [PATCH] Fix broken hit test for arcs in via placer Fixes https://gitlab.com/kicad/code/kicad/-/issues/17844 --- 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 bd47b8e49b..252d167b4c 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -3079,7 +3079,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 ); @@ -3089,6 +3089,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;