From 48d0f70ffd07df9ba364808a71407800834f95d3 Mon Sep 17 00:00:00 2001 From: atravita-mods <94934860+atravita-mods@users.noreply.github.com> Date: Thu, 6 Oct 2022 08:16:57 -0400 Subject: fix indexing math again. --- src/SMAPI/Framework/Content/AssetDataForImage.cs | 6 +++--- 1 file 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 /// Overwrite part of the image. /// The image data to patch into the content. - /// The pixel width of the source image. - /// The pixel height of the source image. + /// The pixel width of the original source image. + /// The pixel height of the original source image. /// The part of the to copy (or null to take the whole texture). This must be within the bounds of the texture. /// The part of the content to patch (or null to patch the whole texture). The original content within this area will be erased. This must be within the bounds of the existing spritesheet. /// Indicates how an image should be patched. @@ -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) { -- cgit