Verify MVP UI resolution scaling

This commit is contained in:
2026-05-18 21:20:57 -07:00
parent 2adc683044
commit 485dd61f7a
3 changed files with 69 additions and 3 deletions
@@ -92,6 +92,12 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
const FVector2D Size = AllottedGeometry.GetLocalSize();
const float Scale = FMath::Clamp(UiScale, 0.75f, 1.5f);
constexpr float MinimumPanelMargin = 24.0f;
constexpr float PreferredPanelWidth = 780.0f;
constexpr float PreferredPanelHeight = 430.0f;
const FVector2D AvailablePanelSize(
FMath::Max(320.0f, Size.X - (MinimumPanelMargin * 2.0f)),
FMath::Max(240.0f, Size.Y - (MinimumPanelMargin * 2.0f)));
const FLinearColor BackdropColor = bUseHighContrast ? FLinearColor(0.0f, 0.0f, 0.0f, 0.96f) : FLinearColor(0.015f, 0.018f, 0.014f, 0.92f);
const FLinearColor PanelColor = bUseHighContrast ? FLinearColor(0.0f, 0.0f, 0.0f, 0.98f) : FLinearColor(0.035f, 0.045f, 0.034f, 0.96f);
const FLinearColor AccentColor = bUseHighContrast ? FLinearColor(0.95f, 0.95f, 0.30f, 1.0f) : FLinearColor(0.45f, 0.72f, 0.40f, 1.0f);
@@ -105,8 +111,8 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
BackdropColor);
const FVector2D PanelSize(
FMath::Min(Size.X - 48.0f, 780.0f * Scale),
FMath::Min(Size.Y - 48.0f, 430.0f * Scale));
FMath::Min(AvailablePanelSize.X, PreferredPanelWidth * Scale),
FMath::Min(AvailablePanelSize.Y, PreferredPanelHeight * Scale));
const FVector2D PanelPosition(
(Size.X - PanelSize.X) * 0.5f,
(Size.Y - PanelSize.Y) * 0.5f);