overview docker: preserve aspect ratio and don't stretch when some layers are hidden
ClosedPublic

Authored by Beuc on Dec 19 2018, 6:26 PM.

Details

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

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Beuc created this revision.Dec 19 2018, 6:26 PM
Restricted Application added a reviewer: Krita. · View Herald TranscriptDec 19 2018, 6:26 PM
Restricted Application added a project: Krita. · View Herald Transcript
Beuc requested review of this revision.Dec 19 2018, 6:26 PM
Beuc edited the summary of this revision. (Show Details)Dec 19 2018, 6:35 PM
Beuc edited the test plan for this revision. (Show Details)
rempt accepted this revision.Dec 24 2018, 11:17 AM
This revision is now accepted and ready to land.Dec 24 2018, 11:17 AM
This revision was automatically updated to reflect the committed changes.
Beuc added a comment.Dec 26 2018, 8:32 PM

By the way this patch was intended to the 4.1 branch, you'll want to replicate it there.

In D17695#382476, @Beuc wrote:

By the way this patch was intended to the 4.1 branch, you'll want to replicate it there.

Pushed! :)