Skip to content

Add "Mirror Canvas Around Cursor" action

Adds an action to mirror the view around the cursor instead of the center of the screen. See https://krita-artists.org/t/can-i-set-up-mirror-view-m-to-flip-on-cursor-instead-of-screen-center/27121/33

Initially I had just added a config option, but raghukamath suggested adding a separate action, which although I doubt people would use both and it's a bit weird because they're both checkboxes, it is far more discoverable than the config option.

I have a few minor doubts:

  • Both actions use the same icon still, does it need a separate one?
  • Should a default shortcut be set? The shortest shortcut available for the M key is Ctrl+Shift+M which is uncomfortable to press from the left, although okay from the right. But I think most people will just want to replace M with this not have 2 shortcuts.
  • The popup palette and overview docker have the mirror button that uses the "Mirror View" action. For the overview docker it maybe doesn't make much sense to flip at cursor but for the popup palette it possibly does?, although I tried this and it feels weird. So didn't do anything about either.

Test Plan

Canvas should mirror around the cursor when using the new action: Draw a point, flip with cursor over point => you should still be hovering over that point.

It should not matter which mirror action is used. The little mirror notification should toggle between on/off correctly (not toggle to the same state twice). For example, one can flip around center (notification = ON), then flip back around cursor (OFF), and so on. Toggle states of the actions in the menu should also match.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • [n/a] 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.
Edited by Dmitry Kazakov

Merge request reports