feat: update AnchorItem Padding Converter.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user