Skip to content

Maintain a fixed relative position of the document in canvas only mode

Maciej Jesionowski requested to merge yavn/krita:canvas-only-offset into master

When entering the canvas only mode, try to account for the hidden dockers and toolars and pan the canvas so that the document stays in the same position on the screen.

This patch implements the feature request: (the part about canvas' position).

Demo on Windows 11:

Test Plan

TODO: Not verified on Android (not sure if this code path even applies there).

This is a bit tricky to test, because there's a lot of interactions with stuff like:

  • Is the main window maximized or not?
  • Are we using subwindows or tabs?
  • Are we using a secondary monitor (with a weird desktop position, orientation)
  • Various canvas-only options in settings
  • Detached canvas
  • Zoom mode (scale to fit)

Windows and Linux (Ubuntu 22.04 Xwayland) look good to me.

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.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list,

Edited by Maciej Jesionowski

Merge request reports