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

@@ -69,4 +69,28 @@ internal static class ComponentChromeCornerRadiusHelper
var safetyScale = ResolveContentSafetyScale(chromeContext, responsiveness);
return Math.Clamp(baseValue * safetyScale, min * safetyScale, max * safetyScale);
}
public static Thickness SafeThickness(
double left,
double top,
double right,
double bottom,
ComponentChromeContext? chromeContext = null,
double responsiveness = 0.45d)
{
return new Thickness(
SafeValue(left, 0, left, chromeContext, responsiveness),
SafeValue(top, 0, top, chromeContext, responsiveness),
SafeValue(right, 0, right, chromeContext, responsiveness),
SafeValue(bottom, 0, bottom, chromeContext, responsiveness));
}
public static Thickness SafeThickness(
double horizontal,
double vertical,
ComponentChromeContext? chromeContext = null,
double responsiveness = 0.45d)
{
return SafeThickness(horizontal, vertical, horizontal, vertical, chromeContext, responsiveness);
}
}