I fiddled with this a lot and still haven't found a good solution to this.
Positioning Elements with calculated Pixels didn't really help.
I read an old thread about a technique of having a frame that you parent everything to instead of UIParent. And then scale that frame correctly so everything is 1px.
Lua Code:
G.frame = CreateFrame("Frame", nil, self)
local _, height = GetPhysicalScreenSize()
G.frame:SetAllPoints(UIParent)
G.frame:SetScale(768 / height)
Sadly it doesn't seem to fix many of my issues.
I tried out ElvUI and actually noticed they have the same issue on some UI scales. When I click like on Medium or whatever the names of their scales were they actually had some 2px Borders.
Is there maybe just no good fix to this?