diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-09-17 19:21:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-17 19:21:04 -0400 |
commit | 00fee3ff43d6a5e2beff65936d416eadd15bde66 (patch) | |
tree | ab3a13f7ee373a6a99a5c91c8559dc69a89014f1 /src/SMAPI/Framework | |
parent | de84adb47751c96fc60be66f6fdb186a09160820 (diff) | |
parent | daa6ad3b95b3e8bec96629dc06fe25f330b99e95 (diff) | |
download | SMAPI-00fee3ff43d6a5e2beff65936d416eadd15bde66.tar.gz SMAPI-00fee3ff43d6a5e2beff65936d416eadd15bde66.tar.bz2 SMAPI-00fee3ff43d6a5e2beff65936d416eadd15bde66.zip |
Merge pull request #731 from Platonymous/patch-1
Allow for negative values in Rectangle
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r-- | src/SMAPI/Framework/Serialization/RectangleConverter.cs | 2 |
1 files changed, 1 insertions, 1 deletions
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:(?<x>\d+) Y:(?<y>\d+) Width:(?<width>\d+) Height:(?<height>\d+)\}$", RegexOptions.IgnoreCase); + var match = Regex.Match(str, @"^\{X:(?<x>-?\d+) Y:(?<y>-?\d+) Width:(?<width>-?\d+) Height:(?<height>-?\d+)\}$", RegexOptions.IgnoreCase); if (!match.Success) throw new SParseException($"Can't parse {nameof(Rectangle)} from invalid value '{str}' (path: {path})."); |