swift-win32
swift-win32 copied to clipboard
Labels appear cropped if display scaling is enabled
If I enable 200% scaling in the Windows display settings, labels produced by Swift/Win32 appear cropped in half.
![](https://user-images.githubusercontent.com/3801618/125197217-6f312c80-e265-11eb-9135-155ce40b2eec.png)
Normally scaling is handled by View.frame.didSet
:
https://github.com/compnerd/swift-win32/blob/2867392ac45f2ed66077ba664dea761687432ee4/Sources/SwiftWin32/Views%20and%20Controls/View.swift#L358
However, the Label
component creates a WC_STATIC
subcomponent with a non-scaled frame:
https://github.com/compnerd/swift-win32/blob/2867392ac45f2ed66077ba664dea761687432ee4/Sources/SwiftWin32/Views%20and%20Controls/Label.swift#L49
Hmm, I guess for the tests we could just interposition the query functions and replace the returned value. Either way, it would be nice to be able to test this, but we should just fix this in the mean time.
This has been addressed. It would still be good to be able to test this.