Bug 489311 - Round UI elements of widgets render incorrectly with fractional scaling factor
Summary: Round UI elements of widgets render incorrectly with fractional scaling factor
Status: CONFIRMED
Alias: None
Product: frameworks-ksvg
Classification: Frameworks and Libraries
Component: General (show other bugs)
Version: 6.3.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-27 13:57 UTC by Pavel Dobiáš
Modified: 2024-07-31 11:06 UTC (History)
4 users (show)

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


Attachments
Audio Volume - Desktop Widget (61.01 KB, image/png)
2024-06-27 13:57 UTC, Pavel Dobiáš
Details
Audio Volume - Panel Widget (48.62 KB, image/png)
2024-06-27 13:58 UTC, Pavel Dobiáš
Details
Bluetooth - Panel Widget (20.64 KB, image/png)
2024-06-27 13:58 UTC, Pavel Dobiáš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Dobiáš 2024-06-27 13:57:09 UTC
Created attachment 171085 [details]
Audio Volume - Desktop Widget

SUMMARY
UI elements, like radio buttons, toggles and slider, of widgets/applets render incorrectly. The shape of the circle isn't smooth and appears to be cut around the edges. It isn't a consistent issue, as it depends on the size and the specific applet. Some applets like Audio Volume have it consistent with radio buttons, Bluetooth one with the toggle.

STEPS TO REPRODUCE
1. Create an applet/widget containing round UI elements, such as "Audio Volume"
2. Set fractional scaling of the display (e.g. 125%)
3. Mesa around with the size of the applet and observe round elements

OBSERVED RESULT
The round UI elements, like radio buttons, toggles or sliders, are cut around the edges and don't look like smooth circles. See attached screenshot and take a close look at them.

EXPECTED RESULT
The round UI elements should render as smooth circles.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 40 KDE Spin
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
Display: 1920x1080@125%
Comment 1 Pavel Dobiáš 2024-06-27 13:58:40 UTC
Created attachment 171086 [details]
Audio Volume - Panel Widget
Comment 2 Pavel Dobiáš 2024-06-27 13:58:58 UTC
Created attachment 171087 [details]
Bluetooth - Panel Widget
Comment 3 Marco Martin 2024-06-27 14:20:30 UTC
while here seems to happen much less on 125% as well, i see it here and there, i think is possibly a ksvg (svgitem perhaps) issue where the final texture is just a tad too small for the final rendering
Comment 4 Marco Martin 2024-06-27 15:08:26 UTC
seems QSvgRenderer::boundsOnElement() might me not as precise as needed, especially that in the end we need to render it on a qpixmap which in the end has of course an integer width and height.

if we do a round on the size, we might end up with some of the antialiasing of the curve cut off, but if we always ceil() the size, then the edges of the curve are correctly rendered, but then there might be unwanted almost transparent pixels around images, for instance square ones that we want to tile (like framesvg center elements) will not tile cleanly anymore
Comment 5 Pavel Dobiáš 2024-07-31 11:06:35 UTC
Might be related to https://bugs.kde.org/show_bug.cgi?id=479891 as the temporary fix mentioned there, involving QT_SCALE_FACTOR_ROUNDING_POLICY, has solved this problem as well.