Fix incorrect conversion from lines to rect in fp editor.

Fixes #10965
https://gitlab.com/kicad/code/kicad/issues/10965
This commit is contained in:
jean-pierre charras 2022-02-25 12:41:57 +01:00
parent 5f1976f341
commit 0f497d1b7a
1 changed files with 5 additions and 1 deletions

View File

@ -297,9 +297,10 @@ void GRAPHICS_CLEANER::mergeRects()
if( !m_dryRun )
{
PCB_SHAPE* rect;
FP_SHAPE* fp_rect = nullptr;
if( m_parentFootprint )
rect = new FP_SHAPE( m_parentFootprint );
rect = fp_rect = new FP_SHAPE( m_parentFootprint );
else
rect = new PCB_SHAPE();
@ -310,6 +311,9 @@ void GRAPHICS_CLEANER::mergeRects()
rect->SetLayer( top->shape->GetLayer() );
rect->SetWidth( top->shape->GetWidth() );
if( fp_rect )
fp_rect->SetLocalCoord();
m_commit.Add( rect );
m_commit.Remove( left->shape );
m_commit.Remove( top->shape );