mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
37 lines
990 B
C#
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;
|
|
}
|
|
}
|
|
} |