Center image after edit operation changed size

Authored by muhlenpfordt on Apr 12 2018, 1:27 PM.

Description

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

Details

Committed
muhlenpfordtApr 16 2018, 6:28 AM
Reviewer
Gwenview
Differential Revision
D12167: Center image after edit operation changed size
Parents
R260:f11f5a43b4a6: Fix reloading of SVG images
Branches
Unknown
Tags
Unknown