Browse Source

Fix incorrect size of the displayed worksheet when starting eeschema or gerbview without file loaded.

It was due to not fully initialized VIEW parameters the first time COMMON_TOOLS::ZoomFitScreen() is called.
pull/15/head
jean-pierre charras 6 years ago
parent
commit
b428d74281
  1. 4
      common/tool/common_tools.cpp

4
common/tool/common_tools.cpp

@ -238,6 +238,10 @@ int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent )
BOX2I bBox = frame->GetDocumentExtents();
BOX2I defaultBox = canvas->GetDefaultViewBBox();
VECTOR2D scrollbarSize = VECTOR2D( canvas->GetSize() - canvas->GetClientSize() );
view->SetScale( 1.0 ); // the best scale will be fixed later, from this initial value
// but this call ensure all view parameters are up to date
// especially at init time
VECTOR2D screenSize = view->ToWorld( canvas->GetClientSize(), false );
if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )

Loading…
Cancel
Save