From 6c67dfa03248651239f24480fe9160931c9b1e8b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 29 Jun 2021 00:57:22 +0100 Subject: [PATCH] Improve eeschema colour preview zoom-to-fit a bit. --- eeschema/dialogs/panel_eeschema_color_settings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eeschema/dialogs/panel_eeschema_color_settings.cpp b/eeschema/dialogs/panel_eeschema_color_settings.cpp index a911dac1e3..562b93b1c1 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_color_settings.cpp @@ -445,7 +445,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::updatePreview() void PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview() { - auto view = m_preview->GetView(); + KIGFX::VIEW* view = m_preview->GetView(); view->SetScale( 1.0 ); 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 ), 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() ); m_preview->ForceRefresh(); }