mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Simplified the different properties used for layer/shape rendering
Cleaned up UI layer shape service
This commit is contained in:
1 parent
f57aca3475
commit
fd9dd626f8
17 files changed
+192
-284
No files matched your search
@@ -43,8 +43,8 @@ namespace Artemis.Plugins.LayerBrushes.Noise
|
||||
public override void Render(SKCanvas canvas)
|
||||
{
|
||||
// Scale down the render path to avoid computing a value for every pixel
|
||||
var width = (int) (Math.Max(Layer.AbsoluteRectangle.Width, Layer.AbsoluteRectangle.Height) / Scale);
|
||||
var height = (int) (Math.Max(Layer.AbsoluteRectangle.Width, Layer.AbsoluteRectangle.Height) / Scale);
|
||||
var width = (int) (Math.Max(Layer.Bounds.Width, Layer.Bounds.Height) / Scale);
|
||||
var height = (int) (Math.Max(Layer.Bounds.Width, Layer.Bounds.Height) / Scale);
|
||||
var opacity = (float) Math.Round(Settings.Color.Alpha / 255.0, 2, MidpointRounding.AwayFromZero);
|
||||
using (var bitmap = new SKBitmap(new SKImageInfo(width, height)))
|
||||
{
|
||||
@@ -77,7 +77,7 @@ namespace Artemis.Plugins.LayerBrushes.Noise
|
||||
using (var sh = SKShader.CreateBitmap(bitmap, SKShaderTileMode.Mirror, SKShaderTileMode.Mirror, SKMatrix.MakeScale(Scale, Scale)))
|
||||
using (var paint = new SKPaint {Shader = sh, BlendMode = Settings.BlendMode})
|
||||
{
|
||||
canvas.DrawPath(Layer.LayerShape.RenderPath, paint);
|
||||
canvas.DrawPath(Layer.LayerShape.Path, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user