Browse Source

Fixed japanese number input crash

Krzysztof Krysiński 2 years ago
parent
commit
30fa498e22
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/PixiEditor/Helpers/Converters/ToolSizeToIntConverter.cs

+ 8 - 2
src/PixiEditor/Helpers/Converters/ToolSizeToIntConverter.cs

@@ -1,5 +1,6 @@
 using System;
 using System;
 using System.Globalization;
 using System.Globalization;
+using System.Text;
 using System.Text.RegularExpressions;
 using System.Text.RegularExpressions;
 using System.Windows.Data;
 using System.Windows.Data;
 
 
@@ -28,6 +29,11 @@ internal class ToolSizeToIntConverter
             return null;
             return null;
         }
         }
 
 
-        return int.Parse(match.Groups[0].ValueSpan);
+        if (int.TryParse(match.Groups[0].ValueSpan.ToString().Normalize(NormalizationForm.FormKC), out int result))
+        {
+            return result;
+        }
+
+        return null;
     }
     }
-}
+}