From 5877e4dd208e310d40fae1f22645e41f83c83046 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Sun, 27 Nov 2022 20:04:04 +0000 Subject: [PATCH] Cleaned up ProfileService render condition --- src/Artemis.Core/Models/Profile/Profile.cs | 2 +- src/Artemis.Core/Services/Storage/ProfileService.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Artemis.Core/Models/Profile/Profile.cs b/src/Artemis.Core/Models/Profile/Profile.cs index 4d68dda3e..e5899b6aa 100644 --- a/src/Artemis.Core/Models/Profile/Profile.cs +++ b/src/Artemis.Core/Models/Profile/Profile.cs @@ -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); diff --git a/src/Artemis.Core/Services/Storage/ProfileService.cs b/src/Artemis.Core/Services/Storage/ProfileService.cs index 801419d52..4b86f3d55 100644 --- a/src/Artemis.Core/Services/Storage/ProfileService.cs +++ b/src/Artemis.Core/Services/Storage/ProfileService.cs @@ -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)