summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoratravita-mods <94934860+atravita-mods@users.noreply.github.com>2022-10-06 08:16:57 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-10-08 13:27:08 -0400
commit48d0f70ffd07df9ba364808a71407800834f95d3 (patch)
treee4ecfbe62e98c7b336ce99f0e6c62b73af71b45e
parent798a56bd2e94e9e60b588222c730e313c3dbe075 (diff)
downloadSMAPI-48d0f70ffd07df9ba364808a71407800834f95d3.tar.gz
SMAPI-48d0f70ffd07df9ba364808a71407800834f95d3.tar.bz2
SMAPI-48d0f70ffd07df9ba364808a71407800834f95d3.zip
fix indexing math again.
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForImage.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/Content/AssetDataForImage.cs b/src/SMAPI/Framework/Content/AssetDataForImage.cs
index 068634b3..636d4a71 100644
--- a/src/SMAPI/Framework/Content/AssetDataForImage.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForImage.cs
@@ -137,8 +137,8 @@ namespace StardewModdingAPI.Framework.Content
/// <summary>Overwrite part of the image.</summary>
/// <param name="sourceData">The image data to patch into the content.</param>
- /// <param name="sourceWidth">The pixel width of the source image.</param>
- /// <param name="sourceHeight">The pixel height of the source image.</param>
+ /// <param name="sourceWidth">The pixel width of the original source image.</param>
+ /// <param name="sourceHeight">The pixel height of the original source image.</param>
/// <param name="sourceArea">The part of the <paramref name="sourceData"/> to copy (or <c>null</c> to take the whole texture). This must be within the bounds of the <paramref name="sourceData"/> texture.</param>
/// <param name="targetArea">The part of the content to patch (or <c>null</c> to patch the whole texture). The original content within this area will be erased. This must be within the bounds of the existing spritesheet.</param>
/// <param name="patchMode">Indicates how an image should be patched.</param>
@@ -183,7 +183,7 @@ namespace StardewModdingAPI.Framework.Content
return; // apparently a completely blank texture?
int endIndex = -1;
- for (int i = pixelCount - 1; i >= startIndex; i--)
+ for (int i = startRow * sourceArea.Width + pixelCount - 1; i >= startIndex; i--)
{
if (sourceData[i].A >= MinOpacity)
{