Zoom to fit: only consider worksheet if there are no other items
This commit is contained in:
parent
d0926cce58
commit
9094a17795
|
@ -227,14 +227,7 @@ int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent )
|
||||||
VECTOR2D screenSize = view->ToWorld( galCanvas->GetClientSize(), false );
|
VECTOR2D screenSize = view->ToWorld( galCanvas->GetClientSize(), false );
|
||||||
|
|
||||||
if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
|
if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
|
||||||
{
|
|
||||||
bBox = defaultBox;
|
bBox = defaultBox;
|
||||||
}
|
|
||||||
else if( defaultBox.GetWidth() > 0 && defaultBox.GetHeight() > 0 )
|
|
||||||
{
|
|
||||||
// Ensure worksheet is included in bounding box
|
|
||||||
bBox.Merge( defaultBox );
|
|
||||||
}
|
|
||||||
|
|
||||||
VECTOR2D vsize = bBox.GetSize();
|
VECTOR2D vsize = bBox.GetSize();
|
||||||
double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
|
double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
|
||||||
|
|
Loading…
Reference in New Issue