Bug 420286

Summary: ShadowedRectangle is not pixel aligned
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Noah Davis <noahadvs>
Component: generalAssignee: Marco Martin <notmart>
Status: REOPENED ---    
Severity: minor CC: ahiemstra, nate, uhhadd
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: top left corner of a ShadowedRectangle with default parameters
red border with a width of 2
Kirigami cards after D28625

Description Noah Davis 2020-04-19 02:45:06 UTC
Created attachment 127678 [details]
top left corner of a ShadowedRectangle with default parameters

SUMMARY
The sides of ShadowedRectangle are not pixel aligned, but the corners are.

STEPS TO REPRODUCE
1. Create a ShadowedRectangle. Default parameters or any combination of border and shadow parameters will work.

OBSERVED RESULT
Sides are farther inside than the corners

EXPECTED RESULT
Sides should be pixel aligned and aligned with the corners

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20200415
KDE Plasma Version: 5.18.80 (git master)
KDE Frameworks Version: 5.70 (git master)
Qt Version: 5.14.1
Comment 1 Noah Davis 2020-04-19 03:05:11 UTC
Created attachment 127679 [details]
red border with a width of 2

Actually, I'm not exactly sure how to describe it succinctly with words now, but this screenshot should show the issue.
Comment 2 Arjen Hiemstra 2020-04-21 10:08:48 UTC
I have just landed https://phabricator.kde.org/D28625 which contains a fix for a pixel alignment issue I saw with the border. Please try and see if that also fixes your case.
Comment 3 Noah Davis 2020-04-21 17:26:52 UTC
Created attachment 127756 [details]
Kirigami cards after D28625

Unfortunately, it didn't fix the issue. Even if I hardcode the border size in DefaultCardBackground to 1, it still looks the same as the picture I've just attached.
Comment 4 Arjen Hiemstra 2020-04-22 09:13:44 UTC
*** Bug 420404 has been marked as a duplicate of this bug. ***
Comment 5 Arjen Hiemstra 2020-04-22 12:51:56 UTC
I did some further tweaking in https://phabricator.kde.org/D29092 . This still has some slightly haloing around certain edges, which unfortunately is pretty much unavoidable with the rendering techniques involved without sacrificing any antialiasing for the corners.