[needs testing] Rewrite for the canvas zoom/rotate/pan system

Hi, all!

I have spent the last 3 weeks on a complete rewrite of the Krita system that is responsible for canvas zooming, rotation, mirroring and panning. This new version of the system should allow us to fix some FPS issues (later, in Qt6 version) and make the port to QML easier.

Since this rewrite changes a lot of stuff (and by “a lot” I mean “reaaallly a lot”), I would need your help with testing if the canvas still works correctly with your workflow. I had to also touch implementation of quite a few of shortcuts, so I could accidentally change their behavior. Please check the ones you use normally, do they still work as expected?

The formal list of the things that could be affected:

  1. Canvas panning, zooming, rotation and mirroring should work as before
  2. Scrollbars around the canvas should work as usual
  3. Rulers should have consistent state, whatever pan/zoom/rotate/mirror settings are
  4. Rulers should track pointers when requested
  5. Infinity manager should work as expected (when you drag the canvas to one side, a special button should appear to automatically extend the canvas)
  6. Zoom widgets at the bottom-right corner should behave correctly. If you set “Fit Page”, then the box should show “Fit Page” even when you resize the Krita window (there was a bug with that before this patch)
  7. Use print size button should work as expected in all the zoom modes (the “monitor” button at the very bottom-right corner of the window)
  8. The shortcuts like Ctrl+= and Ctrl± should behave correctly and switch between the predefined zooms in the zoom widget
  9. The canvas actions like Ctrl+Space+Drag should work as expected
  10. Touch gestures for pan and zoom should work as before
  11. Migrating Krita from one screen to another should adjust the zoom correctly (especially in “use print size” mode)
  12. Migrating between screens with different HiDPI scaling factors should work correctly
  13. Resizing Krita window should keep zoom modes intact and zoom to page if needed
  14. Switching canvas only mode should keep zoom modes intact and zoom to page if needed

I have checked this points locally on my systems, but, perhaps, I missed something? Could you please help me and check the packages? If you confirm there are no regressions, I will merge the patch into Krita 5.3 :slight_smile:

  • Merge request: link
  • Windows package: link
  • Linux package: link
4 Likes

Tested with my local Krita 6 build on macOS. I didn’t test anything with multi-screen setup. Otherwise, everything seems mostly fine as far as I can tell.

Issue, may or may not be related to this patch:

  • Mirror with Fit Page jumps by around 1px. Without this patch, sometimes the canvas stays in place, sometimes it jumps by 1px or more. So I’m not sure if it’s a regression. It might also be expected if the canvas viewport width is odd…

Qt6 issues (not related to this patch):

  • Resizing dockers in Fit Page mode causes the canvas to flicker in and out of existence, switching to Canvas-Only causes the canvas to jump briefly. It seems to be an issue with some recent Qt6 patches, happens on Krita-6-prealpha-10ea89b nightly from June 12, but not on 862e152 from May 15).
  • Cmd-/Cmd+ zoom twice, because Cmd-/Cmd+ are mapped in Keyboard Shortcuts and -/= are also mapped in Canvas Input. Happens on the Krita-6-prealpha-862e152 nightly, might be a general Qt6 issue (on Qt5, it zooms once).

Other notes:

  • The Zoom widget keeps “Fit Page” unlike before. But a side effect of the bug was that you could see what the Fit Page zoom level actually was. Can we do something like “Fit Page (140%)”?
  • Ruler position updates seem choppy, but apparently it’s normal.

Test on win 11:
Seems to be working fine.

  1. OK - Canvas panning, zooming, rotation and mirroring should work as before
  2. OK - Scrollbars around the canvas should work as usual
  3. OK - Rulers should have consistent state, whatever pan/zoom/rotate/mirror settings are
  4. OK - Rulers should track pointers when requested
  5. OK but UNDO does not update view emediately, need to e.g move the canvas to trigger the update | Infinity manager should work as expected (when you drag the canvas to one side, a special button should appear to automatically extend the canvas)
  6. OK - Zoom widgets at the bottom-right corner should behave correctly. If you set “Fit Page”, then the box should show “Fit Page” even when you resize the Krita window (there was a bug with that before this patch)
  7. OK - Use print size button should work as expected in all the zoom modes (the “monitor” button at the very bottom-right corner of the window)
  8. OK but tested with custom shortcuts (e.g. ctrl+num++ = rotate) | The shortcuts like Ctrl+= and Ctrl± should behave correctly and switch between the predefined zooms in the zoom widget
  9. NOT TESTET due to custom shortcuts | The canvas actions like Ctrl+Space+Drag should work as expected
  10. NOT TESTET | Touch gestures for pan and zoom should work as before
  11. NOT TESTET | Migrating Krita from one screen to another should adjust the zoom correctly (especially in “use print size” mode)
  12. NOT TESTET | Migrating between screens with different HiDPI scaling factors should work correctly
  13. OK but what means "zoom to page if needed? It just keeps the chosen zoom level. | Resizing Krita window should keep zoom modes intact and zoom to page if needed
  14. OK but what means "zoom to page if needed? It just keeps the chosen zoom level. | Switching canvas only mode should keep zoom modes intact and zoom to page if needed

Please update us here, when the merge was done.

I can confirm, no problems here on my linux-machine.

I only can say, that the rulers are slower than in 2.9 and are lagging behind. not much but visible.

I could not test the touch features.

Now this the development I can really get behind.

ON my brief testing canvas canvas-related activities like panning, zooming, rotation and mirrors works as expected on windows. More test with Linux will be conducted on Sunday

Fedora 42 KDE 6.4.2

All without issues, except for:

5 - pardon but… I don’t know how to access nor test such thing (first time I hear about it actually)
10–14- unable to test

Hi, all!

Thank you very much for testing! I will merge the patch, so that it will appear in tomorrow’s nightlies, it looks safe! :slight_smile:

And thanks, @freyalupen, for the set of minor regressions. I will try to fix them tomorrow, after the merge :slight_smile:

1 Like

Merged in Fix KisInfinityManager to work correctly in fixed zoom mode (6fb3f0c6) · Commits · Graphics / Krita · GitLab ! :slight_smile:

2 Likes

Does this mean that the current nightly still includes those regressions?

Well, the only real regression is this:

The Zoom widget keeps “Fit Page” unlike before. But a side effect of the bug was that you could see what the Fit Page zoom level actually was. Can we do something like “Fit Page (140%)”?

Which is, the “correct” behavior of the widget makes it a little bit less user-friendly :slight_smile:

Other issues are not related to the patch :slight_smile:

Hi, @freyalupen!

Thanks for detailed descriptions of the issues. I have checked them:

  • Mirror with Fit Page jumps by around 1px.

I’ve fixed in master after the merge

  • Resizing dockers in Fit Page mode causes the canvas to flicker in and out of existence,

Might be related to the Qt patches, but I cannot see that on the Linux or Windows builds. Some video might be helpful.

  • Cmd-/Cmd+ zoom twice, because Cmd-/Cmd+ are mapped in Keyboard Shortcuts and -/= are also mapped in Canvas Input. Happens on the Krita-6-prealpha-862e152 nightly, might be a general Qt6 issue (on Qt5, it zooms once).

Cannot reproduce on Linux, must be some MacOS-specific issue

  • The Zoom widget keeps “Fit Page” unlike before. But a side effect of the bug was that you could see what the Fit Page zoom level actually was. Can we do something like “Fit Page (140%)”?

Changed in the proposed way :slight_smile:

  • Ruler position updates seem choppy, but apparently it’s normal.

That is a “fix” in master that made them choppy to not affect the painting :frowning:

1 Like

The canvas is wobbling around when I zoom in and out.
I’m using krita 5.3.0 alpha git commit 5cb0c86

Edit: About the os:

Hi, @443eb9!

Thank you for the report! I can reproduce it here locally, looks like a regression :frowning:

1 Like