Improve eeschema colour preview zoom-to-fit a bit.

This commit is contained in:
Jeff Young 2021-06-29 00:57:22 +01:00
parent a1dfc36233
commit 6c67dfa032
1 changed files with 2 additions and 2 deletions

View File

@ -445,7 +445,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview()
void PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview() void PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview()
{ {
auto view = m_preview->GetView(); KIGFX::VIEW* view = m_preview->GetView();
view->SetScale( 1.0 ); view->SetScale( 1.0 );
VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false ); VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
@ -454,7 +454,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview()
double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.x ), double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.x ),
fabs( psize.y / screenSize.y ) ); fabs( psize.y / screenSize.y ) );
view->SetScale( scale * 1.1 ); view->SetScale( scale * m_galDisplayOptions.m_scaleFactor * 0.8 /* margin */ );
view->SetCenter( m_drawingSheet->ViewBBox().Centre() ); view->SetCenter( m_drawingSheet->ViewBBox().Centre() );
m_preview->ForceRefresh(); m_preview->ForceRefresh();
} }