mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Core - Apply opacity layer only when fading
This commit is contained in:
parent
5877e4dd20
commit
c8a3169688
@ -123,17 +123,25 @@ public sealed class Profile : ProfileElement
|
||||
|
||||
foreach (ProfileScript profileScript in Scripts)
|
||||
profileScript.OnProfileRendering(canvas, canvas.LocalClipBounds);
|
||||
|
||||
using var opacityPaint = new SKPaint();
|
||||
if (Configuration.FadeInAndOut && Opacity < 1)
|
||||
|
||||
SKPaint? opacityPaint = null;
|
||||
bool applyOpacityLayer = Configuration.FadeInAndOut && Opacity < 1;
|
||||
|
||||
if (applyOpacityLayer)
|
||||
{
|
||||
opacityPaint = new SKPaint();
|
||||
opacityPaint.Color = new SKColor(0, 0, 0, (byte)(255d * Easings.CubicEaseInOut(Opacity)));
|
||||
|
||||
canvas.SaveLayer(opacityPaint);
|
||||
canvas.SaveLayer(opacityPaint);
|
||||
}
|
||||
|
||||
foreach (ProfileElement profileElement in Children)
|
||||
profileElement.Render(canvas, basePosition, editorFocus);
|
||||
|
||||
canvas.Restore();
|
||||
if (applyOpacityLayer)
|
||||
{
|
||||
canvas.Restore();
|
||||
opacityPaint?.Dispose();
|
||||
}
|
||||
|
||||
foreach (ProfileScript profileScript in Scripts)
|
||||
profileScript.OnProfileRendered(canvas, canvas.LocalClipBounds);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user