Properly initialize sheets when loading them from ERC dialog

When displaying a sheet from this path, it's possible the sheet will
not have been initialized yet.  Call DisplayCurrentSheet() to make sure
it is initialized, and then call RedrawScreen to update the zoom level.

Fixes: lp:1824362
* https://bugs.launchpad.net/kicad/+bug/1824362

(cherry picked from commit 1c235a5c89)
This commit is contained in:
Jon Evans 2019-04-13 12:24:59 -04:00
parent 68c2f06074
commit 734e61d4c2
1 changed files with 3 additions and 2 deletions

View File

@ -281,9 +281,10 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
if( sheetList[i] != m_parent->GetCurrentSheet() )
{
sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
m_parent->SetCurrentSheet( sheetList[i] );
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
m_parent->DisplayCurrentSheet();
sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
m_parent->RedrawScreen( m_parent->GetScrollCenterPosition(), false );
}
m_lastMarkerFound = marker;