fixed issue #847
a little bit of zoomToFit sprinkling.
Merge pull request #1197 from ne0fhyk/fix_issue_847

Fix issue 847