mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
31 lines
685 B
C#
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;
|
|
}
|
|
|