swift-win32 icon indicating copy to clipboard operation
swift-win32 copied to clipboard

Labels appear cropped if display scaling is enabled

Open egorzhdan opened this issue 2 years ago • 1 comments

If I enable 200% scaling in the Windows display settings, labels produced by Swift/Win32 appear cropped in half.

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

egorzhdan avatar Jul 11 '21 13:07 egorzhdan

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.

compnerd avatar Jul 11 '21 17:07 compnerd

This has been addressed. It would still be good to be able to test this.

compnerd avatar Sep 27 '23 01:09 compnerd