mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Code cleanup
This commit is contained in:
1 parent
0c245ba83d
commit
ae330c3769
73 files changed
+372
-364
No files matched your search
@@ -12,8 +12,8 @@ namespace Artemis.Core.Models.Profile.KeyframeEngines
|
||||
|
||||
protected override object GetInterpolatedValue()
|
||||
{
|
||||
var currentKeyframe = (Keyframe<SKSize>)CurrentKeyframe;
|
||||
var nextKeyframe = (Keyframe<SKSize>)NextKeyframe;
|
||||
var currentKeyframe = (Keyframe<SKSize>) CurrentKeyframe;
|
||||
var nextKeyframe = (Keyframe<SKSize>) NextKeyframe;
|
||||
|
||||
var widthDiff = nextKeyframe.Value.Width - currentKeyframe.Value.Width;
|
||||
var heightDiff = nextKeyframe.Value.Height - currentKeyframe.Value.Height;
|
||||
|
||||
@@ -328,7 +328,7 @@ namespace Artemis.Core.Models.Profile
|
||||
|
||||
var propertyEntity = LayerEntity.PropertyEntities.FirstOrDefault(p => p.Id == layerProperty.Id && p.ValueType == layerProperty.Type.Name);
|
||||
// TODO: Catch serialization exceptions and log them
|
||||
if (propertyEntity != null)
|
||||
if (propertyEntity != null)
|
||||
layerProperty.ApplyToProperty(propertyEntity);
|
||||
|
||||
_properties.Add(layerProperty.Id, layerProperty);
|
||||
@@ -354,7 +354,8 @@ namespace Artemis.Core.Models.Profile
|
||||
|
||||
private void CreateDefaultProperties()
|
||||
{
|
||||
var transformProperty = new LayerProperty<object>(this, null, "Core.Transform", "Transform", "The default properties collection every layer has, allows you to transform the shape.") {ExpandByDefault = true};
|
||||
var transformProperty = new LayerProperty<object>(this, null, "Core.Transform", "Transform", "The default properties collection every layer has, allows you to transform the shape.")
|
||||
{ExpandByDefault = true};
|
||||
AnchorPointProperty = new LayerProperty<SKPoint>(this, transformProperty, "Core.AnchorPoint", "Anchor Point", "The point at which the shape is attached to its position.");
|
||||
PositionProperty = new LayerProperty<SKPoint>(this, transformProperty, "Core.Position", "Position", "The position of the shape.");
|
||||
SizeProperty = new LayerProperty<SKSize>(this, transformProperty, "Core.Size", "Size", "The size of the shape.") {InputAffix = "%"};
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
public string InputAffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether this property can use keyframes, True by default.
|
||||
/// Gets or sets whether this property can use keyframes, True by default.
|
||||
/// </summary>
|
||||
public bool CanUseKeyframes { get; set; }
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
@@ -26,8 +25,8 @@ namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
var currentValue = base.GetCurrentValue();
|
||||
return currentValue == null ? default : (T)currentValue;
|
||||
var currentValue = GetCurrentValue();
|
||||
return currentValue == null ? default : (T) currentValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,10 @@ namespace Artemis.Core.Models.Profile.LayerShapes
|
||||
/// Updates Position and Size using the provided unscaled rectangle
|
||||
/// </summary>
|
||||
/// <param name="rect">An unscaled rectangle which is relative to the layer (1.0 being full width/height, 0.5 being half).</param>
|
||||
/// <param name="time">An optional timespan to indicate where to set the properties, if null the properties' base values will be used.</param>
|
||||
/// <param name="time">
|
||||
/// An optional timespan to indicate where to set the properties, if null the properties' base values
|
||||
/// will be used.
|
||||
/// </param>
|
||||
public void SetFromUnscaledRectangle(SKRect rect, TimeSpan? time)
|
||||
{
|
||||
if (!Layer.Leds.Any())
|
||||
|
||||
Reference in new issue
Block a user