1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Cleaned up ProfileService render condition

This commit is contained in:
Diogo Trindade 2022-11-27 20:04:04 +00:00
parent b39dd14526
commit 5877e4dd20
2 changed files with 3 additions and 2 deletions

View File

@ -125,7 +125,7 @@ public sealed class Profile : ProfileElement
profileScript.OnProfileRendering(canvas, canvas.LocalClipBounds);
using var opacityPaint = new SKPaint();
if (Configuration.FadeInAndOut && Opacity != 1)
if (Configuration.FadeInAndOut && Opacity < 1)
opacityPaint.Color = new SKColor(0, 0, 0, (byte)(255d * Easings.CubicEaseInOut(Opacity)));
canvas.SaveLayer(opacityPaint);

View File

@ -263,7 +263,8 @@ internal class ProfileService : IProfileService
{
ProfileConfiguration profileConfiguration = profileCategory.ProfileConfigurations[j];
// Ensure all criteria are met before rendering
if (!profileConfiguration.IsSuspended && !profileConfiguration.IsMissingModule && (profileConfiguration.ActivationConditionMet || (profileConfiguration.Profile?.ShouldDisplay == false && profileConfiguration.Profile?.Opacity >= 0)))
bool fadingOut = profileConfiguration.Profile?.ShouldDisplay == false && profileConfiguration.Profile?.Opacity > 0;
if (!profileConfiguration.IsSuspended && !profileConfiguration.IsMissingModule && (profileConfiguration.ActivationConditionMet || fadingOut))
profileConfiguration.Profile?.Render(canvas, SKPointI.Empty, null);
}
catch (Exception e)