Skip to content

Fix wrong handling of rotation in KisToolRectangleBase

This MR is a follow-up to #4f0137a1. That commit fixed the wobbliness of the rectangle outline, but introduced a bug with respect to the rotation of the rectangle (ctrl + alt modifiers). It appears that with only those changes the rectangle started rotating with respect to its center, instead of the top-left/start-corner, as before.

I think that all the code regarding the transformes rectangle is too messy and hard to understand, so I tried to just make it work by changing the KisToolRectangleBase::createRect method. The other approaches I thought of trying would imply modifying code in more places, like shape tools, etc. So I just tried several combinations of transformations and other things until I kind of got it working. I don't know if this is the correct approach to be honest, although it works.

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