Files
LanMountainDesktop/LanMountainDesktop.DesktopComponents.Runtime/ComponentTypographyLayoutModels.cs
2026-03-20 10:22:40 +08:00

31 lines
685 B
C#

using Avalonia;
using Avalonia.Media;
namespace LanMountainDesktop.DesktopComponents.Runtime;
public readonly record struct ComponentAdaptiveTextLayout(
double FontSize,
FontWeight Weight,
int MaxLines,
double LineHeight,
double OverflowScore,
bool FitsCompletely,
Size MeasuredSize)
{
public double MeasuredWidth => MeasuredSize.Width;
public double MeasuredHeight => MeasuredSize.Height;
}
public readonly record struct ComponentBoxLayout(
double Width,
double Height,
Thickness Margin,
Thickness Padding)
{
public double Size => Math.Max(Width, Height);
public bool IsSquare => Math.Abs(Width - Height) <= 0.001d;
}