From 591894c7e6ca12d69b54f1eaa96914b1b02ea69e Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 3 Apr 2019 16:26:43 -0400 Subject: [PATCH] Properly construct new line from old Fixes: lp:1823072 * https://bugs.launchpad.net/kicad/+bug/1823072 --- eeschema/sch_line.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 7c8acdf017..81836c443d 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -457,7 +457,8 @@ EDA_ITEM* SCH_LINE::MergeOverlap( SCH_LINE* aLine ) if( ( leftmost_start == other_start ) && ( leftmost_end == other_end ) ) // Trivial case { - auto ret = new SCH_LINE( leftmost_start ); + auto ret = new SCH_LINE( *aLine ); + ret->SetStartPoint( leftmost_start ); ret->SetEndPoint( leftmost_end ); return ret; } @@ -495,7 +496,8 @@ EDA_ITEM* SCH_LINE::MergeOverlap( SCH_LINE* aLine ) { leftmost_end = rightmost_end; - auto ret = new SCH_LINE( leftmost_start ); + auto ret = new SCH_LINE( *aLine ); + ret->SetStartPoint( leftmost_start ); ret->SetEndPoint( leftmost_end ); return ret; }