From daa6ad3b95b3e8bec96629dc06fe25f330b99e95 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 17 Sep 2020 23:50:30 +0200 Subject: Allow for negative values in Rectangle --- src/SMAPI/Framework/Serialization/RectangleConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/Serialization/RectangleConverter.cs b/src/SMAPI/Framework/Serialization/RectangleConverter.cs index a5780d8a..8f7318b3 100644 --- a/src/SMAPI/Framework/Serialization/RectangleConverter.cs +++ b/src/SMAPI/Framework/Serialization/RectangleConverter.cs @@ -37,7 +37,7 @@ namespace StardewModdingAPI.Framework.Serialization if (string.IsNullOrWhiteSpace(str)) return Rectangle.Empty; - var match = Regex.Match(str, @"^\{X:(?\d+) Y:(?\d+) Width:(?\d+) Height:(?\d+)\}$", RegexOptions.IgnoreCase); + var match = Regex.Match(str, @"^\{X:(?-?\d+) Y:(?-?\d+) Width:(?-?\d+) Height:(?-?\d+)\}$", RegexOptions.IgnoreCase); if (!match.Success) throw new SParseException($"Can't parse {nameof(Rectangle)} from invalid value '{str}' (path: {path})."); -- cgit