This commit is contained in:
lincube
2026-03-20 10:22:40 +08:00
parent 915739ff7b
commit aeae4be060
40 changed files with 1666 additions and 571 deletions

View File

@@ -0,0 +1,30 @@
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;
}