Fix view shifting when infobar is shown.

(cherry picked from commit df4fefeb20)
This commit is contained in:
Alex 2023-06-02 17:46:46 +03:00
parent e76a520c19
commit b957d5176e
1 changed files with 4 additions and 1 deletions

View File

@ -365,7 +365,10 @@ void EDA_DRAW_PANEL_GAL::onSize( wxSizeEvent& aEvent )
if( m_view ) if( m_view )
{ {
if( infobar && infobar->IsLocked() ) if( infobar && infobar->IsLocked() )
m_view->SetCenter( bottom - m_view->ToWorld( clientSize, false ) / 2.0 ); {
VECTOR2D halfScreen( std::ceil( 0.5 * clientSize.x ), std::ceil( 0.5 * clientSize.y ) );
m_view->SetCenter( bottom - m_view->ToWorld( halfScreen, false ) );
}
m_view->MarkTargetDirty( KIGFX::TARGET_CACHED ); m_view->MarkTargetDirty( KIGFX::TARGET_CACHED );
m_view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); m_view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );