Skip to content
  • Peter Mühlenpfordt's avatar
    Center image after edit operation changed size · b0111d43
    Peter Mühlenpfordt authored
    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 {nav 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
    
    {F5806553}
    
    * Open image in View Mode
    * Resize to a size smaller than viewport
    * Resize to an even smaller size
    * Image should display centered
    
    {F5806555}
    
    Reviewers: #gwenview, rkflx
    
    Reviewed By: #gwenview, rkflx
    
    Subscribers: rkflx
    
    Differential Revision: https://phabricator.kde.org/D12167
    b0111d43