Center image after edit operation changed size
Summary:
After editing an image which changes its size (crop, resize) or
undoing this operation the image is not centered in the viewport
in some cases.
This patch adds a check if document size changed when calculating
zoom factor and view offset.
FIXED-IN: 18.04.1
Test Plan:
- Open image in View Mode with zoom option Fit and fit height
- Edit one time to show save bar (e.g. rotate or resize)
- Crop to a narrow upright bar (zoom should not change)
- Undo
- Previous image should display complete and centered
- Open image in View Mode
- Resize to a size smaller than viewport
- Resize to an even smaller size
- Image should display centered
Reviewers: Gwenview, rkflx
Reviewed By: Gwenview, rkflx
Subscribers: rkflx
Differential Revision: https://phabricator.kde.org/D12167