mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-14 03:25:07 -05:00
LargeDialogBounds computes the bounds the large browse dialogs open at: nine tenths of the owner screen's working area, centered, never below the dialog's minimum size. WinForms' DialogBounds now calls it with the screen's working area, with unchanged behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
813 B
C#
29 lines
813 B
C#
namespace OpenNest.Desktop.Tests;
|
|
|
|
public class LargeDialogBoundsTests
|
|
{
|
|
[Fact]
|
|
public void Centered_NineTenthsOfTheWorkingArea()
|
|
{
|
|
var bounds = LargeDialogBounds.Centered(new PixelRect(0, 0, 1920, 1040), 800, 600);
|
|
|
|
Assert.Equal(new PixelRect(96, 52, 1728, 936), bounds);
|
|
}
|
|
|
|
[Fact]
|
|
public void Centered_OnASecondaryScreen()
|
|
{
|
|
var bounds = LargeDialogBounds.Centered(new PixelRect(1920, -200, 2560, 1400), 800, 600);
|
|
|
|
Assert.Equal(new PixelRect(1920 + 128, -200 + 70, 2304, 1260), bounds);
|
|
}
|
|
|
|
[Fact]
|
|
public void Centered_NeverBelowTheMinimumOrBeforeTheWorkingArea()
|
|
{
|
|
var bounds = LargeDialogBounds.Centered(new PixelRect(100, 50, 1000, 700), 1200, 900);
|
|
|
|
Assert.Equal(new PixelRect(100, 50, 1200, 900), bounds);
|
|
}
|
|
}
|