Skip math if above is fully opaque.

This commit is contained in:
atravita-mods 2022-08-16 16:46:10 -04:00 committed by Jesse Plamondon-Willard
parent 4a1055e573
commit 581763c363
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 3 additions and 3 deletions

View File

@ -160,13 +160,13 @@ namespace StardewModdingAPI.Framework.Content
// merge pixels
for (int i = 0; i < pixelCount; i++)
{
ref Color above = ref sourceData[i];
ref Color below = ref mergedData[i];
Color above = sourceData[i];
Color below = mergedData[i];
// shortcut transparency
if (above.A < MinOpacity)
continue;
if (below.A < MinOpacity)
if (below.A < MinOpacity || above.A == byte.MaxValue)
mergedData[i] = above;
// merge pixels