Project cleanup

This commit is contained in:
Robert committed 2020-02-13 15:17:58 +01:00
1 parent f5e95e43be
commit 3aa9a632ea
51 files changed
+440 -490

No files matched your search

@@ -38,6 +38,24 @@ namespace Artemis.Plugins.LayerBrushes.Color
public LayerProperty<SKColor> ColorProperty { get; set; }
public LayerProperty<GradientType> GradientTypeProperty { get; set; }
public override void Update(double deltaTime)
{
// Only recreate the shader if the color changed
if (_color != ColorProperty.CurrentValue)
{
_color = ColorProperty.CurrentValue;
CreateShader();
}
base.Update(deltaTime);
}
public override void Render(SKCanvas canvas, SKPath path, SKPaint paint)
{
paint.Shader = _shader;
canvas.DrawPath(path, paint);
}
private void CreateShader()
{
var center = new SKPoint(Layer.Bounds.MidX, Layer.Bounds.MidY);
@@ -67,24 +85,6 @@ namespace Artemis.Plugins.LayerBrushes.Color
oldShader?.Dispose();
oldPaint?.Dispose();
}
public override void Update(double deltaTime)
{
// Only recreate the shader if the color changed
if (_color != ColorProperty.CurrentValue)
{
_color = ColorProperty.CurrentValue;
CreateShader();
}
base.Update(deltaTime);
}
public override void Render(SKCanvas canvas, SKPath path, SKPaint paint)
{
paint.Shader = _shader;
canvas.DrawPath(path, paint);
}
}
public enum GradientType