Bug 408143

Summary: Overview Docker, 4.2.0 onwards, has canvas image scaling and position problems with small images
Product: [Applications] krita Reporter: Ahab Greybeard <ahab.greybeard>
Component: DockersAssignee: Tiar <tamtamy.tymona>
Status: RESOLVED FIXED    
Severity: normal CC: ghevan, tamtamy.tymona
Priority: NOR    
Version: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Overview docker screenshots - scaling/position problem

Description Ahab Greybeard 2019-05-31 11:27:18 UTC
Created attachment 120428 [details]
Overview docker screenshots - scaling/position problem

SUMMARY
This happens in 4.2.0 and the latest nightly appimages.
If a small image is used, the Overview docker gives incorrect presentation of the canvas image and the blue rectangle workspace 'view hole' on the docker.
The problem is worse for smaller images and worse for larger docker sizes.
It does not happen in 4.1.7 where the docker can be made any size you like and still maintains a correct presentation.

STEPS TO REPRODUCE
1. Make an image of 300 x 200 pixels and draw some content in it (for reference and comparison)
2. Adjust the Overview docker to be large in size. Floating it onto a second monitor (if you have one) is a good way to see and examine this.

OBSERVED RESULT
The attached .zip file has screenshots to illustrate the problem
A-..png shows the full 300x200 image. B-..png shows the 4.2.0 Overview docker at a 'large' size with workspace zoom set to Fill Page.
If you zoom in so the central 'v' shape fills the canvas, you get C-..png which is obviously wrong, whereas D-..png shows the 4.1.7 correct presentation.
If you reduce the docker size to 'medium' in 4.2.0, you get as shown in E-..png, which is wrong in a slightly different way.

EXPECTED RESULT
The docker should give a full and accurate display at all docker sizes for all image sizes, as it does in 4.1.7.

SOFTWARE/OS VERSIONS
Krita

 Version: 4.3.0-prealpha (git eecd08a)
 Languages: en_GB, en
 Hidpi: true

Qt

  Version (compiled): 5.12.2
  Version (loaded): 5.12.2

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.9.0-9-amd64
  Pretty Productname: Debian GNU/Linux 9 (stretch)
  Product Type: debian
  Product Version: 9

ADDITIONAL INFORMATION
Comment 1 Tiar 2020-09-08 15:52:56 UTC
Git commit 65217e247f9cf9f649d27ed1fdebd793b179ec5e by Agata Cacko.
Committed on 08/09/2020 at 15:52.
Pushed by tymond into branch 'master'.

Fix small images and pixel art in Overview docker

Before this commit, pxel art would be displayed
in Overview docker in an unconvenient size.
This commit fixes this behaviour by making sure
pixel art images are scaled up properly.

Note: "pixel art" here describes any image for which
the Overview docker pixels count is bigger than the image
itself (so the image needs to be scaled up).

Fixes include:
- fix in OverviewThumbnailStrokeStrategy to not
scale down if the image wasn't oversampled or scaled up before.
(which was the actual problem)
- change in OTSStrategy to use Bilinear for normal images and NN for
pixel art
- change in Overview docker to clean up usages of different size
calculations

M  +8    -4    plugins/dockers/overview/OverviewThumbnailStrokeStrategy.cpp
M  +2    -1    plugins/dockers/overview/OverviewThumbnailStrokeStrategy.h
M  +24   -11   plugins/dockers/overview/overviewwidget.cc
M  +24   -5    plugins/dockers/overview/overviewwidget.h

https://invent.kde.org/graphics/krita/commit/65217e247f9cf9f649d27ed1fdebd793b179ec5e
Comment 2 Tiar 2020-09-08 20:32:26 UTC
Git commit 9423b0f0b04b50f32762ed4238a4339543f16041 by Agata Cacko.
Committed on 08/09/2020 at 20:32.
Pushed by tymond into branch 'krita/4.3'.

Fix small images and pixel art in Overview docker

Before this commit, pxel art would be displayed
in Overview docker in an unconvenient size.
This commit fixes this behaviour by making sure
pixel art images are scaled up properly.

Note: "pixel art" here describes any image for which
the Overview docker pixels count is bigger than the image
itself (so the image needs to be scaled up).

Fixes include:
- fix in OverviewThumbnailStrokeStrategy to not
scale down if the image wasn't oversampled or scaled up before.
(which was the actual problem)
- change in OTSStrategy to use Bilinear for normal images and NN for
pixel art
- change in Overview docker to clean up usages of different size
calculations


(cherry picked from commit 65217e247f9cf9f649d27ed1fdebd793b179ec5e)

M  +8    -4    plugins/dockers/overview/OverviewThumbnailStrokeStrategy.cpp
M  +2    -1    plugins/dockers/overview/OverviewThumbnailStrokeStrategy.h
M  +24   -11   plugins/dockers/overview/overviewwidget.cc
M  +24   -5    plugins/dockers/overview/overviewwidget.h

https://invent.kde.org/graphics/krita/commit/9423b0f0b04b50f32762ed4238a4339543f16041