more indexing errors joy

This commit is contained in:
atravita-mods 2022-11-14 11:38:10 -05:00
parent 72f5df2d20
commit e2c1d2b1c9
1 changed files with 3 additions and 2 deletions

View File

@ -163,7 +163,8 @@ namespace StardewModdingAPI.Framework.Content
int startIndex = -1;
int endIndex = -1;
{
for (int i = startRow * sourceArea.Width; i < pixelCount; i++)
int endPixel = pixelCount + startRow * sourceArea.Width;
for (int i = startRow * sourceArea.Width; i < endPixel; i++)
{
if (sourceData[i].A >= AssetDataForImage.MinOpacity)
{
@ -174,7 +175,7 @@ namespace StardewModdingAPI.Framework.Content
if (startIndex == -1)
return; // blank texture
for (int i = startRow * sourceArea.Width + pixelCount - 1; i >= startIndex; i--)
for (int i = endPixel - 1; i >= startIndex; i--)
{
if (sourceData[i].A >= AssetDataForImage.MinOpacity)
{