mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
RGB.NET - Updated for latest development branch
This commit is contained in:
parent
606c1b80f2
commit
7792b662e0
@ -300,7 +300,7 @@ namespace Artemis.Core
|
||||
|
||||
internal void CalculateRenderProperties()
|
||||
{
|
||||
Rectangle = RgbDevice.DeviceRectangle.ToSKRect();
|
||||
Rectangle = RgbDevice.Boundary.ToSKRect();
|
||||
if (!Leds.Any())
|
||||
return;
|
||||
|
||||
|
||||
@ -46,10 +46,12 @@ namespace Artemis.Core
|
||||
private set => SetAndNotify(ref _absoluteRectangle, value);
|
||||
}
|
||||
|
||||
public ArtemisLedLayout? Layout { get; set; }
|
||||
|
||||
internal void CalculateRectangles()
|
||||
{
|
||||
Rectangle = RgbLed.LedRectangle.ToSKRect();
|
||||
AbsoluteRectangle = RgbLed.AbsoluteLedRectangle.ToSKRect();
|
||||
Rectangle = RgbLed.Boundary.ToSKRect();
|
||||
AbsoluteRectangle = RgbLed.AbsoluteBoundary.ToSKRect();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
10
src/Artemis.Core/Models/Surface/ArtemisLedLayout.cs
Normal file
10
src/Artemis.Core/Models/Surface/ArtemisLedLayout.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Artemis.Core
|
||||
{
|
||||
public class ArtemisLedLayout
|
||||
{
|
||||
public ArtemisLed Led { get; set; }
|
||||
public Uri Image { get; set; }
|
||||
}
|
||||
}
|
||||
@ -66,7 +66,7 @@ namespace Artemis.Core.Services.Models
|
||||
{
|
||||
HorizontalArrangementPosition.Left => devices.Min(d => d.RgbDevice.Location.X) - (AppliedConfiguration?.MarginLeft ?? 0.0),
|
||||
HorizontalArrangementPosition.Right => devices.Max(d => d.RgbDevice.Location.X + d.RgbDevice.Size.Width) + (AppliedConfiguration?.MarginRight ?? 0.0),
|
||||
HorizontalArrangementPosition.Center => devices.First().RgbDevice.DeviceRectangle.Center.X,
|
||||
HorizontalArrangementPosition.Center => devices.First().RgbDevice.Boundary.Center.X,
|
||||
HorizontalArrangementPosition.Equal => devices.First().RgbDevice.Location.X,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(horizontalPosition), horizontalPosition, null)
|
||||
};
|
||||
@ -74,7 +74,7 @@ namespace Artemis.Core.Services.Models
|
||||
{
|
||||
VerticalArrangementPosition.Top => devices.Min(d => d.RgbDevice.Location.Y) - (AppliedConfiguration?.MarginTop ?? 0.0),
|
||||
VerticalArrangementPosition.Bottom => devices.Max(d => d.RgbDevice.Location.Y + d.RgbDevice.Size.Height) + (AppliedConfiguration?.MarginBottom ?? 0.0),
|
||||
VerticalArrangementPosition.Center => devices.First().RgbDevice.DeviceRectangle.Center.Y,
|
||||
VerticalArrangementPosition.Center => devices.First().RgbDevice.Boundary.Center.Y,
|
||||
VerticalArrangementPosition.Equal => devices.First().RgbDevice.Location.Y,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(verticalPosition), verticalPosition, null)
|
||||
};
|
||||
|
||||
@ -21,8 +21,8 @@ namespace Artemis.UI.Shared
|
||||
Led.RgbLed.Size.Height
|
||||
);
|
||||
|
||||
if (Led.RgbLed.Image != null && File.Exists(Led.RgbLed.Image.AbsolutePath))
|
||||
LedImage = new BitmapImage(Led.RgbLed.Image);
|
||||
if (Led.Layout?.Image != null && File.Exists(Led.Layout.Image.AbsolutePath))
|
||||
LedImage = new BitmapImage(Led.Layout.Image);
|
||||
|
||||
CreateLedGeometry();
|
||||
}
|
||||
|
||||
@ -57,7 +57,6 @@
|
||||
<!-- TODO: Remove when moving to Nuget, this is so the plugin templates have the DLL to reference -->
|
||||
<Reference Include="RGB.NET.Brushes">
|
||||
<HintPath>..\..\..\RGB.NET\bin\net5.0\RGB.NET.Brushes.dll</HintPath>
|
||||
<Private>true</Private>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Core">
|
||||
<HintPath>..\..\..\RGB.NET\bin\net5.0\RGB.NET.Core.dll</HintPath>
|
||||
|
||||
@ -134,19 +134,19 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
|
||||
|
||||
private Geometry CreateRectangleGeometry(ArtemisLed led)
|
||||
{
|
||||
Rect rect = led.RgbLed.AbsoluteLedRectangle.ToWindowsRect(1);
|
||||
Rect rect = led.RgbLed.AbsoluteBoundary.ToWindowsRect(1);
|
||||
return new RectangleGeometry(rect);
|
||||
}
|
||||
|
||||
private Geometry CreateCircleGeometry(ArtemisLed led)
|
||||
{
|
||||
Rect rect = led.RgbLed.AbsoluteLedRectangle.ToWindowsRect(1);
|
||||
Rect rect = led.RgbLed.AbsoluteBoundary.ToWindowsRect(1);
|
||||
return new EllipseGeometry(rect);
|
||||
}
|
||||
|
||||
private Geometry CreateCustomGeometry(ArtemisLed led, double deflateAmount)
|
||||
{
|
||||
Rect rect = led.RgbLed.AbsoluteLedRectangle.ToWindowsRect(1);
|
||||
Rect rect = led.RgbLed.AbsoluteBoundary.ToWindowsRect(1);
|
||||
try
|
||||
{
|
||||
PathGeometry geometry = Geometry.Combine(
|
||||
|
||||
@ -48,7 +48,7 @@ namespace Artemis.UI.Screens.SurfaceEditor.Visualization
|
||||
|
||||
public Rect DeviceRectangle => Device.RgbDevice == null
|
||||
? new Rect()
|
||||
: new Rect(Device.X, Device.Y, Device.RgbDevice.DeviceRectangle.Size.Width, Device.RgbDevice.DeviceRectangle.Size.Height);
|
||||
: new Rect(Device.X, Device.Y, Device.RgbDevice.Boundary.Size.Width, Device.RgbDevice.Boundary.Size.Height);
|
||||
|
||||
public bool CanDetectInput => Device.RgbDevice.DeviceInfo.DeviceType == RGBDeviceType.Keyboard ||
|
||||
Device.RgbDevice.DeviceInfo.DeviceType == RGBDeviceType.Mouse;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user