SizeConverter : update regex value to allow negative values

This commit is contained in:
Romain Aubert 2023-07-05 08:22:08 +02:00 committed by Lorenz Cuno Klopfenstein
parent f59db2c01e
commit 63e9487423

View file

@ -46,7 +46,7 @@ namespace OnTopReplica.StartupOptions {
return base.ConvertTo(context, culture, value, destinationType);
}
static Regex _sizeRegex = new Regex("^\\D*(?<x>\\d*)\\s*,\\s*(?<y>\\d*)\\D*$",
static Regex _sizeRegex = new Regex("^[^0-9-]*(?<x>-?\\d*)\\s*,\\s*(?<y>-?\\d*)\\D*$",
RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Singleline);
private Size StringToSize(string s) {