Disable multi-via dragging.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20150

(cherry picked from commit d0e86cad7c)
This commit is contained in:
Jeff Young
2025-03-03 16:13:40 +00:00
parent 12d3f54da4
commit a246a96d18
+8 -4
View File
@@ -515,12 +515,16 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( doDrag )
{
bool isTracks = m_selection.GetSize() > 0
&& m_selection.OnlyContains( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } );
size_t segs = m_selection.CountType( PCB_TRACE_T );
size_t arcs = m_selection.CountType( PCB_ARC_T );
size_t vias = m_selection.CountType( PCB_VIA_T );
// Note: multi-track dragging is currently supported, but not multi-via
bool routable = ( segs >= 1 || arcs >= 1 || vias == 1 )
&& ( segs + arcs + vias == m_selection.GetSize() );
if( isTracks && trackDragAction == TRACK_DRAG_ACTION::DRAG )
if( routable && trackDragAction == TRACK_DRAG_ACTION::DRAG )
m_toolMgr->RunAction( PCB_ACTIONS::drag45Degree );
else if( isTracks && trackDragAction == TRACK_DRAG_ACTION::DRAG_FREE_ANGLE )
else if( routable && trackDragAction == TRACK_DRAG_ACTION::DRAG_FREE_ANGLE )
m_toolMgr->RunAction( PCB_ACTIONS::dragFreeAngle );
else
m_toolMgr->RunAction( PCB_ACTIONS::move );