feat: update AnchorItem Padding Converter.

This commit is contained in:
Zhang Dian
2025-07-10 19:55:34 +08:00
parent b304d585bd
commit 3ae76efd45
4 changed files with 67 additions and 22 deletions

View File

@@ -4,14 +4,15 @@ using Avalonia.Data.Converters;
namespace Ursa.Themes.Semi.Converters;
public class TreeLevelToMarginConverter: IMultiValueConverter
public class TreeLevelToPaddingConverter : IMultiValueConverter
{
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{
if (values[0] is int i && values[1] is double indent)
if (values[0] is int i && values[1] is Thickness indent)
{
return new Thickness(Math.Max(i-1, 0) * indent, 0, 0, 0);
return new Thickness(Math.Max(i, 0) * indent.Left, indent.Top, indent.Right, indent.Bottom);
}
return new Thickness();
}
}