Merge pull request #879 from atravita-mods/FixIndexingAgain

Fix image patching index math
This commit is contained in:
Jesse Plamondon-Willard 2022-10-16 15:12:17 -04:00 committed by GitHub
commit ff9a955c8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ namespace StardewModdingAPI.Framework.Content
int topOffset = startIndex / sourceArea.Width; int topOffset = startIndex / sourceArea.Width;
int bottomOffset = endIndex / sourceArea.Width; int bottomOffset = endIndex / sourceArea.Width;
targetArea = new(targetArea.X, targetArea.Y + topOffset, targetArea.Width, bottomOffset - topOffset + 1); targetArea = new(targetArea.X, targetArea.Y + topOffset - startRow, targetArea.Width, bottomOffset - topOffset + 1);
pixelCount = targetArea.Width * targetArea.Height; pixelCount = targetArea.Width * targetArea.Height;
sourceOffset = topOffset * sourceArea.Width; sourceOffset = topOffset * sourceArea.Width;
} }