1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Layer - Fixed some clipping/blending issues

This commit is contained in:
SpoinkyNL 2020-09-16 23:27:10 +02:00
parent d307f775c7
commit 050eb5bd2f

View File

@ -338,7 +338,6 @@ namespace Artemis.Core
using var layerPaint = new SKPaint
{
FilterQuality = SKFilterQuality.Low,
BlendMode = General.BlendMode.CurrentValue,
Color = new SKColor(0, 0, 0, (byte) (Transform.Opacity.CurrentValue * 2.55f))
};
layerCanvas.Clear();
@ -368,7 +367,14 @@ namespace Artemis.Core
if (Parent is Folder parentFolder)
targetLocation = Path.Bounds.Location - parentFolder.Path.Bounds.Location;
canvas.DrawBitmap(_layerBitmap, targetLocation, layerPaint);
using var canvasPaint = new SKPaint {BlendMode = General.BlendMode.CurrentValue};
using var canvasPath = new SKPath(Path);
canvasPath.Transform(SKMatrix.MakeTranslation(
(canvasPath.Bounds.Left - targetLocation.X) * -1,
(canvasPath.Bounds.Top - targetLocation.Y) * -1)
);
canvas.ClipPath(canvasPath);
canvas.DrawBitmap(_layerBitmap, targetLocation, canvasPaint);
}
private void SimpleRender(SKCanvas canvas, SKImageInfo canvasInfo, SKPaint paint, SKPath layerPath)