eeschema: Fix nullptr reference in intersheet references
Fixes https://gitlab.com/kicad/code/kicad/issues/5881
This commit is contained in:
parent
bdb18022c0
commit
6c2433fed6
|
@ -73,7 +73,7 @@ EDA_ITEM* SCH_IREF::Clone() const
|
|||
|
||||
void SCH_IREF::SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle )
|
||||
{
|
||||
wxPoint pt = GetTextPos() - GetParent()->GetPosition();
|
||||
wxPoint pt = GetTextPos() - m_parentLabel->GetPosition();
|
||||
int offset = std::max( abs( pt.x ), abs( pt.y ) );
|
||||
|
||||
switch( aSpinStyle )
|
||||
|
@ -108,7 +108,7 @@ void SCH_IREF::SetIrefOrientation( LABEL_SPIN_STYLE aSpinStyle )
|
|||
break;
|
||||
}
|
||||
|
||||
SetPosition( GetParent()->GetPosition() + pt );
|
||||
SetPosition( m_parentLabel->GetPosition() + pt );
|
||||
}
|
||||
|
||||
|
||||
|
@ -138,4 +138,4 @@ void SCH_IREF::BuildHypertextMenu( wxMenu* aMenu )
|
|||
|
||||
aMenu->AppendSeparator();
|
||||
aMenu->Append( ID_HYPERTEXT_BACK, _( "Back" ) );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue