nodify-avalonia icon indicating copy to clipboard operation
nodify-avalonia copied to clipboard

Minor fix in UnscaleTransformConverter.cs and SubtractConverter.cs

Open Noemata opened this issue 4 months ago • 0 comments

UnscaleTransformConverter.cs needs the following changes:

   internal class ScalePointConverter : IMultiValueConverter
   {
       public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
       {
           // MP! Check: Avalonia needs this.  Why is MultiValueConverter behavior different from WPF?
           if (values.Any(x => x is UnsetValueType)) return false;

           Point result = (Point)((Vector)(Point)values[0]! * (double)values[1]!);
           return result;
       }

SubtractConverter.cs needs the following changes:

    internal class SubtractConverter : IMultiValueConverter
    {
        public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
        {
            // MP! Check: Avalonia needs this.  Why is MultiValueConverter behavior different from WPF?
            if (values.Any(x => x is UnsetValueType)) return false;

            double result = (double)values[0]! - (double)values[1]!;
            return result;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

Noemata avatar Oct 10 '24 20:10 Noemata