mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Split device views/VMs for surface and profile editors
Added support for devices without images to the surface editor
This commit is contained in:
1 parent
a752c75239
commit
d9c2e7b2dc
13 files changed
+334
-109
No files matched your search
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user