diff --git a/eeschema/sch_iref.cpp b/eeschema/sch_iref.cpp index e3c70eda9d..a63388ea36 100644 --- a/eeschema/sch_iref.cpp +++ b/eeschema/sch_iref.cpp @@ -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" ) ); -} \ No newline at end of file +}