From 363281dd4dc6a3be894b4ca6e329f0895d976d54 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 17 Oct 2019 07:21:20 -0700 Subject: [PATCH] eeschema: add junction when needed for broken wire The break wire command will break all wires at a point. If there are multiple crossing wires, we need to check to see if a junction might be required to reflect the new connection. Fixes: lp:1848450 * https://bugs.launchpad.net/kicad/+bug/1848450 --- eeschema/tools/sch_edit_tool.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 86899bea57..59ff39fab8 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -1364,10 +1364,13 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent ) { - VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) ); + auto cursorPos = wxPoint( getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) ) ); - if( m_frame->BreakSegments( (wxPoint) cursorPos ) ) + if( m_frame->BreakSegments( cursorPos ) ) { + if( m_frame->GetScreen()->IsJunctionNeeded( cursorPos, true ) ) + m_frame->AddJunction( cursorPos, true, false ); + m_frame->TestDanglingEnds(); m_frame->OnModify();