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; }