diff --git a/RGB.NET.Core/Devices/Layout/LedLayout.cs b/RGB.NET.Core/Devices/Layout/LedLayout.cs
index 1b71e5b..deee551 100644
--- a/RGB.NET.Core/Devices/Layout/LedLayout.cs
+++ b/RGB.NET.Core/Devices/Layout/LedLayout.cs
@@ -21,11 +21,12 @@ namespace RGB.NET.Core.Layout
public string Id { get; set; }
///
- /// Gets or sets the of the .
+ /// Gets or sets the descriptive of the .
+ /// This property is for XML-serialization only and should not be directly accessed.
///
[XmlElement("Shape")]
- [DefaultValue(Shape.Rectangle)]
- public Shape Shape { get; set; } = Shape.Rectangle;
+ [DefaultValue("Rectangle")]
+ public string DescriptiveShape { get; set; } = "Rectangle";
///
/// Gets or sets the descriptive x-position of the .
@@ -59,6 +60,18 @@ namespace RGB.NET.Core.Layout
[DefaultValue("1.0")]
public string DescriptiveHeight { get; set; } = "1.0";
+ ///
+ /// Gets or sets the of the .
+ ///
+ [XmlIgnore]
+ public Shape Shape { get; set; }
+
+ ///
+ /// Gets or sets the vecor-data representing a custom-shape of the .
+ ///
+ [XmlIgnore]
+ public string ShapeData { get; set; }
+
///
/// Gets or sets the x-position of the .
///
@@ -94,6 +107,14 @@ namespace RGB.NET.Core.Layout
/// The previously calculated.
public void CalculateValues(DeviceLayout device, LedLayout lastLed)
{
+ Shape shape;
+ if (!Enum.TryParse(DescriptiveShape, true, out shape))
+ {
+ shape = Shape.Custom;
+ ShapeData = DescriptiveShape;
+ }
+ Shape = shape;
+
Width = GetSizeValue(DescriptiveWidth, device.LedUnitWidth);
Height = GetSizeValue(DescriptiveHeight, device.LedUnitHeight);
diff --git a/RGB.NET.Core/Leds/Led.cs b/RGB.NET.Core/Leds/Led.cs
index d4bac50..79c4681 100644
--- a/RGB.NET.Core/Leds/Led.cs
+++ b/RGB.NET.Core/Leds/Led.cs
@@ -33,6 +33,16 @@ namespace RGB.NET.Core
set { SetProperty(ref _shape, value); }
}
+ private string _shapeData;
+ ///
+ /// Gets or sets the data used for by the -.
+ ///
+ public string ShapeData
+ {
+ get { return _shapeData; }
+ set { SetProperty(ref _shapeData, value); }
+ }
+
///
/// Gets a rectangle representing the physical location of the relative to the .
///
diff --git a/RGB.NET.Core/Positioning/Shape.cs b/RGB.NET.Core/Positioning/Shape.cs
index 1d7384d..f4cdfe0 100644
--- a/RGB.NET.Core/Positioning/Shape.cs
+++ b/RGB.NET.Core/Positioning/Shape.cs
@@ -9,14 +9,19 @@ namespace RGB.NET.Core
[Serializable]
public enum Shape
{
+ ///
+ /// A custom shape defined by vector-data.
+ ///
+ Custom = 0,
+
///
/// A simple rectangle.
///
- Rectangle = 0,
+ Rectangle = 1,
///
/// A simple circle.
///
- Circle = 1
+ Circle = 2,
}
}
diff --git a/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs b/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs
index 11c6cf3..5c312e4 100644
--- a/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs
+++ b/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs
@@ -87,6 +87,7 @@ namespace RGB.NET.Devices.Corsair
led.LedRectangle.Size.Height = layoutLed.Height;
led.Shape = layoutLed.Shape;
+ led.ShapeData = layoutLed.ShapeData;
LedImage image = ledImageLayout?.LedImages.FirstOrDefault(x => x.Id == layoutLed.Id);
led.Image = (!string.IsNullOrEmpty(image?.Image))
diff --git a/RGB.NET.WPF/Styles/LedVisualizer.xaml b/RGB.NET.WPF/Styles/LedVisualizer.xaml
index ea212ee..05692ed 100644
--- a/RGB.NET.WPF/Styles/LedVisualizer.xaml
+++ b/RGB.NET.WPF/Styles/LedVisualizer.xaml
@@ -41,6 +41,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+