overview docker: preserve aspect ratio and don't stretch when some layers are hidden
Summary:
Since 58e1c17a58df417dd40f5e4c64fc55eade437efc , the overview docker displays thumbnails for transparent layers incorrectly (e.g. when hiding the background layer or selectively displaying one single layer). The thumbnail is stretch with a wrong aspect ratio.
A solid afternoon of debugging points that the final step of thumbnailing does not provide a size, hence the bounds of the KisPaintDevice are used instead, resulting in a size mismatch.
The attached patch fixes this issue while preserving the fixes from the aforementioned patch.
Note: in 4.1.3, the size also mismatched, but was centered without stretching/resizing in the overview docker with correct aspect ratio; however the canvas viewport outline was wrong.
Test Plan:
- Create a new A4/landscape image
- Create a perfect circle somewhere near the bottom-left of the screen (i.e. not the top-left)
- Check the overview thumbnail (state 1)
- Hide the background layer
- Check that the overview thumbnail is consistent with state 1: same position and correct aspect ratio for the circle
Patch by Beuc (https://phabricator.kde.org/p/Beuc/)
Reviewers: Krita, rempt
Reviewed By: Krita, rempt
Tags: Krita
Differential Revision: https://phabricator.kde.org/D17695