mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Project cleanup
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user