Skip to content

Make mirrorCanvasAroundCursor fallback to mirrorCanvas when not over the viewport

I noticed when working on !1218 (closed) that "Mirror Canvas Around Cursor" is basically useless when it's a toolbar item. Pressing it has no useful effect while also turning on the Mirror state. The fact that it doesn't fallback is additionally a problem if the user replaces their usual shortcut for Mirror View to this action, and then attempts to mirror the canvas while not over the viewport, basically necessitating the use of two different shortcuts.

Thus, this commit makes it so that the function falls back to the typical mirrorCanvas when not over the viewport. From what I can tell, this fallback aspect didn't seem to have been discussed much at all in !994 (merged) , so this change may be disputable.

This feature is not in 5.0 so it's not backportable.

Test Plan

Add the action to the toolbar. Check what happens when pressing it. Check what happens when using the shortcut when the cursor is not over the viewport. Check what happens when using the shortcut when the cursor is over the viewport.

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