Lock crop ratio to current rect when holding Ctrl/Shift

Authored by huoni on Mar 21 2018, 1:19 AM.

Description

Lock crop ratio to current rect when holding Ctrl/Shift

Summary:
In many graphics apps, holding Ctrl and/or Shift locks the ratio of
the rectangle being resized, making it quicker than manually choosing
a ratio. This patch adds this functionality to the Crop tool.

When Ctrl or Shift is pressed, the current ratio of the crop rect
is saved, "locking it". When resizing, so long as Ctrl or Shift is
pressed, the ratio is enforced to this locked value. Otherwise it
behaves the same as before - enforcing ratio if one was chosen in
the GUI

Depends on D11379

Test Plan:

  • Crop tool behaves normally when Ctrl/Shift not pressed
  • Crop ratio locked when Ctrl/Shift is pressed
  • Ctrl/Shift has no effect if ratio is already restricted by the Basic toggle or Advanced combobox

Reviewers: Gwenview, rkflx

Reviewed By: Gwenview, rkflx

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

Details