mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Layer brushes - Render now always originates from 0,0
RGB.NET brushes - GetBrush is no called after properties are initialized Profile editor - Fixed inputs not responding to updates from the visualization tools when keyframes are disabled
This commit is contained in:
1 parent
72485e5d71
commit
97c85e238c
4 files changed
+16
-10
No files matched your search
@@ -207,12 +207,12 @@ namespace Artemis.Core.Models.Profile
|
||||
if (LayerBrush?.BaseProperties == null || !LayerBrush.BaseProperties.PropertiesInitialized)
|
||||
return;
|
||||
|
||||
// TODO: Remove, this is slow and stupid
|
||||
// For now, reset all keyframe engines after the last keyframe was hit
|
||||
// This is a placeholder method of repeating the animation until repeat modes are implemented
|
||||
var properties = new List<BaseLayerProperty>(General.GetAllLayerProperties().Where(p => p.BaseKeyframes.Any()));
|
||||
properties.AddRange(Transform.GetAllLayerProperties().Where(p => p.BaseKeyframes.Any()));
|
||||
properties.AddRange(LayerBrush.BaseProperties.GetAllLayerProperties().Where(p => p.BaseKeyframes.Any()));
|
||||
|
||||
// For now, reset all keyframe engines after the last keyframe was hit
|
||||
// This is a placeholder method of repeating the animation until repeat modes are implemented
|
||||
var timeLineEnd = properties.Any() ? properties.Max(p => p.BaseKeyframes.Max(k => k.Position)) : TimeSpan.MaxValue;
|
||||
if (properties.Any(p => p.TimelineProgress >= timeLineEnd))
|
||||
{
|
||||
@@ -240,8 +240,12 @@ namespace Artemis.Core.Models.Profile
|
||||
/// <inheritdoc />
|
||||
public override void Render(double deltaTime, SKCanvas canvas, SKImageInfo canvasInfo)
|
||||
{
|
||||
// Ensure the layer is ready
|
||||
if (Path == null || LayerShape?.Path == null || !General.PropertiesInitialized || !Transform.PropertiesInitialized)
|
||||
return;
|
||||
// Ensure the brush is ready
|
||||
if (LayerBrush?.BaseProperties?.PropertiesInitialized == false || LayerBrush?.BrushType != LayerBrushType.Regular)
|
||||
return;
|
||||
|
||||
canvas.Save();
|
||||
canvas.ClipPath(Path);
|
||||
@@ -269,9 +273,6 @@ namespace Artemis.Core.Models.Profile
|
||||
|
||||
private void StretchRender(SKCanvas canvas, SKImageInfo canvasInfo, SKPaint paint)
|
||||
{
|
||||
if (LayerBrush == null || !LayerBrush.BaseProperties.PropertiesInitialized || LayerBrush.BrushType != LayerBrushType.Regular)
|
||||
return;
|
||||
|
||||
// Apply transformations
|
||||
var sizeProperty = Transform.Scale.CurrentValue;
|
||||
var rotationProperty = Transform.Rotation.CurrentValue;
|
||||
@@ -293,9 +294,6 @@ namespace Artemis.Core.Models.Profile
|
||||
|
||||
private void ClipRender(SKCanvas canvas, SKImageInfo canvasInfo, SKPaint paint)
|
||||
{
|
||||
if (LayerBrush == null || !LayerBrush.BaseProperties.PropertiesInitialized || LayerBrush.BrushType != LayerBrushType.Regular)
|
||||
return;
|
||||
|
||||
// Apply transformations
|
||||
var sizeProperty = Transform.Scale.CurrentValue;
|
||||
var rotationProperty = Transform.Rotation.CurrentValue;
|
||||
|
||||
Reference in new issue
Block a user