File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -159,21 +159,19 @@ public final class WinUIBackend: AppBackend {
159159 // print(GetDpiForWindow(nil))
160160
161161 if let size {
162- try ! window. appWindow. resizeClient (
163- SizeInt32 (
164- width: Int32 ( size. x) ,
165- height: Int32 ( size. y)
166- )
167- )
162+ setSize ( ofWindow: window, to: size)
168163 }
169164 return window
170165 }
171166
172167 public func size( ofWindow window: Window ) -> SIMD2 < Int > {
173168 let size = window. appWindow. clientSize
169+ let scaleFactor = window. scaleFactor
170+ let width = Double ( size. width) / scaleFactor
171+ let height = Double ( size. height) / scaleFactor
174172 let out = SIMD2 (
175- Int ( size . width) ,
176- Int ( size . height) - CustomWindow. menuBarHeight
173+ Int ( width. rounded ( . towardZero ) ) ,
174+ Int ( height. rounded ( . towardZero ) ) - CustomWindow. menuBarHeight
177175 )
178176 return out
179177 }
You can’t perform that action at this time.
0 commit comments