Bug 456929

Summary: Color profile selector broken display on HiDPI (both the "horseshoe" and the curve chart)
Product: [Applications] krita Reporter: Tiar <tamtamy.tymona>
Component: Color modelsAssignee: amyspark <amy>
Status: RESOLVED FIXED    
Severity: normal CC: amy, halla
Priority: NOR Keywords: regression
Version: 5.1.0-beta1   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed In:

Description Tiar 2022-07-19 22:36:02 UTC
SUMMARY
It seems like they are drawn in a wrong way. My display is 4k, if it matters.

STEPS TO REPRODUCE
1. Go to Image -> Convert Image Color Space 
2. Press "Color profile selector" (probably other places with the color selector have the same issue)
3. Look at curve charts and the horseshoes of different profiles, especially RGB/A since they are the most "normal" ones and should look just as you expect.

OBSERVED RESULT
In the horseshoe, the triangle is partially out of the window. The horseshoe seems to be crossing one of the axis, too. The triangle is mostly out of the horseshoe.
In the curve chart, the curve is only partially visible.

EXPECTED RESULT
The triangle should be inside the horseshoe.
The curve should be wholly visible in the square of the chart.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.2.0-prealpha (git d700876041)
 Hidpi: true

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.13.0-35-generic
  Pretty Productname: Linux Mint 20.3
  Product Type: linuxmint
  Product Version: 20.3
  Desktop: X-Cinnamon
Comment 1 Tiar 2022-07-19 22:44:56 UTC
Versions this bug has been present (bad):
- 88b7b8b824 (master ~ June 2nd 2022)
- 5.1.0-beta1
- 5.1.0-beta2

Versions this bug hasn't been present (good):
- 5214230 (master ~ November 4th 2019)
- 5.0.6
Comment 2 amyspark 2022-07-20 00:54:00 UTC
Cannot reproduce on Windows (commit e747146, with a 1080p SD screen) but I can on macOS (commit a40c361, with a Retina screen).  I think I know where this may have broken: https://invent.kde.org/graphics/krita/-/merge_requests/1317, where I added the devicePixelRatioF() calls to account for HiDPI scaling.

Tiar, since I think your screen is HiDPI, perhaps you can try fixing it by removing those lines?
Comment 3 amyspark 2022-07-20 12:44:36 UTC
Update: could reproduce by manually changing "Make everything bigger" to 125% or higher on Windows. It's indeed the HiDPI changes that cause it, the pixmap size and the painting do not account for the device pixel ratio.

The easiest fix (for the sake of 5.1) would be to remove the lines involving devicePixelRatioF() in KisCieTongueWidget and KisToneCurveWidget.

The best fix (one I've not been able to figure out fully) would be to properly size and scale the pixmaps. I was playing with this last night, but couldn't achieve the latter; I end up with the pixmaps not stretching correctly and getting chopped in the bottom.
Comment 4 Bug Janitor Service 2022-07-20 21:21:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1527
Comment 5 Halla Rempt 2022-08-02 06:46:32 UTC
Git commit f1aa81a32cd3a6338c25df282b392a5bc3f8c228 by Halla Rempt, on behalf of L. E. Segovia.
Committed on 02/08/2022 at 06:46.
Pushed by rempt into branch 'cherry-pick-7af93a6d'.

Color Space Selector: temporarily remove the DPI scaling


(cherry picked from commit 7af93a6dde1db57dbb159c8a058342f2a4128bde)

M  +3    -6    libs/ui/widgets/kis_cie_tongue_widget.cpp
M  +0    -3    libs/ui/widgets/kis_tone_curve_widget.cpp

https://invent.kde.org/graphics/krita/commit/f1aa81a32cd3a6338c25df282b392a5bc3f8c228
Comment 6 Halla Rempt 2022-08-02 06:47:37 UTC
Git commit 9659aea93709c87165c88ec58c076bd860eb02eb by Halla Rempt, on behalf of L. E. Segovia.
Committed on 02/08/2022 at 06:47.
Pushed by rempt into branch 'krita/5.1'.

Color Space Selector: temporarily remove the DPI scaling
(cherry picked from commit 7af93a6dde1db57dbb159c8a058342f2a4128bde)

M  +3    -6    libs/ui/widgets/kis_cie_tongue_widget.cpp
M  +0    -3    libs/ui/widgets/kis_tone_curve_widget.cpp

https://invent.kde.org/graphics/krita/commit/9659aea93709c87165c88ec58c076bd860eb02eb
Comment 7 Halla Rempt 2022-08-02 06:47:45 UTC
Git commit 0f1b3ad5f88ab769322cfe80e5d2c4c1da9d317b by Halla Rempt, on behalf of L. E. Segovia.
Committed on 02/08/2022 at 06:47.
Pushed by rempt into branch 'krita/5.1'.

Color Space Selector: fix HiDPI scaling
(cherry picked from commit 44e35973399e2ad596aec02b75b47310a0405d4f)

M  +30   -27   libs/ui/widgets/kis_cie_tongue_widget.cpp
M  +9    -7    libs/ui/widgets/kis_tone_curve_widget.cpp

https://invent.kde.org/graphics/krita/commit/0f1b3ad5f88ab769322cfe80e5d2c4c1da9d317b