Skip to content

Commit

Permalink
fix first time open crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Oct 9, 2024
1 parent afc9565 commit e2a74e7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public RectInt32 InitializePosition(RectInt32 parentRect, double parentDpi)
PointInt32 center = parentRect.GetPointInt32(PointInt32Kind.Center);
SizeInt32 size = new SizeInt32(640, 800).Scale(parentDpi);
RectInt32 target = RectInt32Convert.RectInt32(new(center.X - (size.Width / 2), center.Y - (size.Height / 2)), size);
RectInt32 workArea = DisplayArea.GetFromRect(parentRect, DisplayAreaFallback.None).WorkArea;
RectInt32 workArea = DisplayArea.GetFromRect(parentRect, DisplayAreaFallback.Primary).WorkArea;
RectInt32 workAreaShrink = new(workArea.X + 48, workArea.Y + 48, workArea.Width - 96, workArea.Height - 96);

if (target.Width > workAreaShrink.Width)
Expand Down

0 comments on commit e2a74e7

Please sign in to comment.