Remove extra pixel when cropping with an aspect ratio

Authored by alexmi on Oct 2 2019, 5:02 PM.

Description

Remove extra pixel when cropping with an aspect ratio

Summary:
This fixes a bug where using the crop tool and resizing the crop
area by adjusting the top left or top right corners with a fixed
aspect ratio will make the crop area's height a pixel higher than
expected. This is because QRect::bottom() doesn't return the
exact y coordinate.

From Qt Documentation: https://doc.qt.io/qt-5/qrect.html#bottom

Test Plan:

  1. Use the crop tool with a 1:1 aspect ratio
  2. Change the crop area by adjusting the top left and top right corners
  3. Verify both width and height have the same value

Reviewers: Gwenview, ngraham

Reviewed By: Gwenview, ngraham

Subscribers: anthonyfieroni

Tags: Gwenview

Differential Revision: https://phabricator.kde.org/D24290

Details

Committed
ngrahamOct 2 2019, 5:06 PM
Reviewer
Gwenview
Differential Revision
D24290: Remove extra pixel when cropping with an aspect ratio
Parents
R260:1a2623d913d1: Change UI for setting jpeg quality to slider
Branches
Unknown
Tags
Unknown