Skip to content

Add middle handles to perspective transform

In addition to the handles on the four corners, there's now also handles in the middle of the sides. Dragging one of them is like moving both corner handles next to them simultaneously, just like e.g. Paint Tool SAI and Drawpile do it.

I couldn't find documentation on what the proper process is, so I added myself to the copyright header and the developers.txt, since this patch isn't quite as trivial as my previous ones. They're in separate commits so that they can be squashed or removed as appropriate.

Test Plan

Have something that can be transformed, like a non-locked, non-empty layer or a selection.

Activate the Transform tool. Switch to Perspective in the Tool Options. There should be 4 additional handles in the transform rectangle, in the middle of the four sides.

Drag the four corner handles and two vanishing point handles around. They should behave as they did before.

Drag the four new middle handles around. They should translate their adjacent corner handles by the dragged amount and transform accordingly.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports