Properly construct new line from old

Fixes: lp:1823072
* https://bugs.launchpad.net/kicad/+bug/1823072
This commit is contained in:
Jon Evans 2019-04-03 16:26:43 -04:00
parent d8cc2f8280
commit 591894c7e6
1 changed files with 4 additions and 2 deletions

View File

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