Files
Artemis/src/Artemis.UI/ViewModels/Controls/SurfaceEditor/SurfaceLedViewModel.cs
T
SpoinkyNL d9c2e7b2dc Split device views/VMs for surface and profile editors
Added support for devices without images to the surface editor
2019-10-12 18:00:21 +02:00

37 lines
990 B
C#

using System;
using RGB.NET.Core;
using Stylet;
namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
{
public class SurfaceLedViewModel : PropertyChangedBase
{
public SurfaceLedViewModel(Led led)
{
Led = led;
Update();
}
public Led Led { get; }
public double X { get; private set; }
public double Y { get; private set; }
public double Width { get; private set; }
public double Height { get; private set; }
public void Update()
{
if (Math.Abs(Led.LedRectangle.X - X) > 0.1)
X = Led.LedRectangle.X;
if (Math.Abs(Led.LedRectangle.Y - Y) > 0.1)
Y = Led.LedRectangle.Y;
if (Math.Abs(Led.LedRectangle.Width - Width) > 0.1)
Width = Led.LedRectangle.Width;
if (Math.Abs(Led.LedRectangle.Height - Height) > 0.1)
Height = Led.LedRectangle.Height;
}
}
}