cleanup and comments

This commit is contained in:
atravita-mods 2022-08-22 23:50:52 -04:00 committed by Jesse Plamondon-Willard
parent 09fd12ddfe
commit a3b8546ec8
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 3 additions and 2 deletions

View File

@ -187,7 +187,7 @@ namespace StardewModdingAPI.Framework.Content
} }
if (startIndex == -1) if (startIndex == -1)
return; return; // apparently a completely blank texture?
int endIndex = -1; int endIndex = -1;
for (int i = pixelCount - 1; i >= startIndex; i--) for (int i = pixelCount - 1; i >= startIndex; i--)
@ -200,8 +200,9 @@ namespace StardewModdingAPI.Framework.Content
} }
if (endIndex == -1) if (endIndex == -1)
return; return; // should never happen
// Calculate new Y bounds
int topoffset = startIndex / sourceArea.Width; int topoffset = startIndex / sourceArea.Width;
int bottomoffset = endIndex / sourceArea.Width; int bottomoffset = endIndex / sourceArea.Width;