@@ -192,7 +192,8 @@ private void ResizeWindow()
192
192
// Adjust the AppWindow size
193
193
var scale = GetDisplayScale ( ) ;
194
194
var height = ( int ) ( desiredSize . Height * scale ) ;
195
- AppWindow . Resize ( new SizeInt32 ( WIDTH , height ) ) ;
195
+ var width = ( int ) ( WIDTH * scale ) ;
196
+ AppWindow . Resize ( new SizeInt32 ( width , height ) ) ;
196
197
}
197
198
198
199
private double GetDisplayScale ( )
@@ -232,12 +233,13 @@ private void MoveWindow()
232
233
private PointInt32 GetWindowPosition ( )
233
234
{
234
235
var height = AppWindow . Size . Height ;
236
+ var width = AppWindow . Size . Width ;
235
237
var cursorPosition = _lastActivatePosition ;
236
238
if ( cursorPosition is null )
237
239
{
238
240
var primaryWorkArea = DisplayArea . Primary . WorkArea ;
239
241
return new PointInt32 (
240
- primaryWorkArea . Width - WIDTH ,
242
+ primaryWorkArea . Width - width ,
241
243
primaryWorkArea . Height - height
242
244
) ;
243
245
}
@@ -252,7 +254,7 @@ private PointInt32 GetWindowPosition()
252
254
) . WorkArea ;
253
255
254
256
// Adjust if the window goes off the right edge of the display.
255
- if ( x + WIDTH > workArea . X + workArea . Width ) x = workArea . X + workArea . Width - WIDTH ;
257
+ if ( x + width > workArea . X + workArea . Width ) x = workArea . X + workArea . Width - width ;
256
258
257
259
// Adjust if the window goes off the bottom edge of the display.
258
260
if ( y + height > workArea . Y + workArea . Height ) y = workArea . Y + workArea . Height - height ;
0 commit comments