fix indexing math again.

This commit is contained in:
atravita-mods 2022-10-06 08:16:57 -04:00 committed by Jesse Plamondon-Willard
parent 798a56bd2e
commit 48d0f70ffd
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 3 additions and 3 deletions

View File

@ -137,8 +137,8 @@ namespace StardewModdingAPI.Framework.Content
/// <summary>Overwrite part of the image.</summary> /// <summary>Overwrite part of the image.</summary>
/// <param name="sourceData">The image data to patch into the content.</param> /// <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="sourceWidth">The pixel width of the original source image.</param>
/// <param name="sourceHeight">The pixel height of the 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="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="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> /// <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? return; // apparently a completely blank texture?
int endIndex = -1; 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) if (sourceData[i].A >= MinOpacity)
{ {