Bug 447624 - Lines in Kirigami apps have different thickness depending on window size when using fractional scaling
Summary: Lines in Kirigami apps have different thickness depending on window size when...
Status: RESOLVED UPSTREAM
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.89.0
Platform: Neon Linux
: NOR normal
Target Milestone: Not decided
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-29 01:56 UTC by nicode25
Modified: 2022-01-12 00:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Resizing Discover in both axes (511.79 KB, video/webm)
2021-12-29 01:56 UTC, nicode25
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nicode25 2021-12-29 01:56:28 UTC
Created attachment 144918 [details]
Resizing Discover in both axes

SUMMARY
When using fractional scaling (150%), vertical and horizontal lines vary between 1 and 2 pixels.

STEPS TO REPRODUCE
1. Enable fractional scaling (150%)
2. Resize an app made with Kirigami (Discover)

OBSERVED RESULT
Line thickness changes.

EXPECTED RESULT
Line thickness should be constant.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-43-generic (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
In the video, I am resizing Discover slowly in both axes.
Comment 1 Nate Graham 2022-01-12 00:34:21 UTC
Unfortunately this is just how fractional scaling works. If you take a single-pixel line and try to scale it up 150%, you end up with a 1.5 pixel line. But oops! There's no such thing as half a pixel. So the rendering engine needs to figure out how to render a 1.5px thick line on a grid of  1.0 pixels. The result depends on how the rendering engine decides to handle this, but there isn't really a good solution, just a series of trade-offs. Maybe Qt could do it better. But that would be up to Qt to fix; there isn't really anything we can do about it here in KDE land.

For more information, see https://community.kde.org/Get_Involved/Design/Lessons_Learned#Pixel-alignment_for_SVG_icons, which is about a similar topic.