Allow shift snapping when placing and dragging assistant handles (bug 406204)
Shift snapping assistant handles only worked after the assistant has been created, by click-dragging the handles. This change allows the user to hold shift to snap handles when the assistant hasn't been completed.
This change addresses this bug https://bugs.kde.org/show_bug.cgi?id=406204, except that Shift can still only be held after the user starts click-dragging the assistant's handles.
Test Plan
Snapping rules for handles when shift is held:
- First 2 handles of any assistant should snap vertically/horizontally to each other
- Elliptical assistant's 3rd handle should snap to circle radius
- Perspective and Spline assistant's 3rd and 4th handles snaps vertically/horizontally to relevant handle
Test that the above works in the following situations:
- During assistant creation
- Dragging handles after assistant is created.
- With multiple different types of assistants on the canvas.
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.