From eb4a2b0b8942e6832eb294683872f2d3d9992ec1 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 19 Jan 2020 10:01:09 -0800 Subject: [PATCH] Prevent overlapping junction inserts 2 pins + 1 line here would mark the same spot twice for a junction. Using a set prevents the duplicates from being inserted --- eeschema/sch_edit_frame.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 946ce47669..0ce03ca806 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1165,7 +1165,8 @@ void SCH_EDIT_FRAME::FixupJunctions() for( const SCH_SHEET_PATH& sheet : sheetList ) { - std::vector junctions; + // We require a set here to avoid adding multiple junctions to the same spot + std::set junctions; SetCurrentSheet( sheet ); GetCurrentSheet().UpdateAllScreenReferences(); @@ -1182,7 +1183,7 @@ void SCH_EDIT_FRAME::FixupJunctions() // Test if a _new_ junction is needed, and add it if missing if( screen->IsJunctionNeeded( pos, true ) ) - junctions.push_back( pos ); + junctions.insert( pos ); } }