diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs
index 3a418f3..c12c931 100644
--- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs
+++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs
@@ -31,10 +31,17 @@ namespace RGB.NET.Core
///
public Size Size
{
- get => _size * Scale;
- protected set => SetProperty(ref _size, value);
+ get => _size;
+ protected set
+ {
+ if (SetProperty(ref _size, value))
+ OnPropertyChanged(nameof(ActualSize));
+ }
}
+ ///
+ public Size ActualSize => Size * Scale;
+
private Point _location = new Point(0, 0);
///
public Point Location
@@ -51,7 +58,7 @@ namespace RGB.NET.Core
set
{
if (SetProperty(ref _scale, value))
- OnPropertyChanged(nameof(Size));
+ OnPropertyChanged(nameof(ActualSize));
}
}
diff --git a/RGB.NET.Core/Devices/IRGBDevice.cs b/RGB.NET.Core/Devices/IRGBDevice.cs
index 9321850..07d28ee 100644
--- a/RGB.NET.Core/Devices/IRGBDevice.cs
+++ b/RGB.NET.Core/Devices/IRGBDevice.cs
@@ -24,10 +24,18 @@ namespace RGB.NET.Core
Point Location { get; set; }
///
- /// Gets a copy of the of the whole .
+ /// Gets the of the .
///
Size Size { get; }
-
+
+ ///
+ /// Gets the actual (scaled and rotated) of the .
+ ///
+ Size ActualSize { get; }
+
+ ///
+ /// Gets or sets the scale of the .
+ ///
Scale Scale { get; set; }
///
diff --git a/RGB.NET.Core/RGBSurface.cs b/RGB.NET.Core/RGBSurface.cs
index 1db3b08..058eda5 100644
--- a/RGB.NET.Core/RGBSurface.cs
+++ b/RGB.NET.Core/RGBSurface.cs
@@ -226,7 +226,7 @@ namespace RGB.NET.Core
private void UpdateSurfaceRectangle()
{
- Rectangle devicesRectangle = new Rectangle(_devices.Select(d => new Rectangle(d.Location, d.Size)));
+ Rectangle devicesRectangle = new Rectangle(_devices.Select(d => new Rectangle(d.Location, d.ActualSize)));
SurfaceRectangle = SurfaceRectangle.SetSize(new Size(devicesRectangle.Location.X + devicesRectangle.Size.Width, devicesRectangle.Location.Y + devicesRectangle.Size.Height));
}
diff --git a/RGB.NET.Core/RGBSurfaceDeviceLoader.cs b/RGB.NET.Core/RGBSurfaceDeviceLoader.cs
index b3fe9e6..f233282 100644
--- a/RGB.NET.Core/RGBSurfaceDeviceLoader.cs
+++ b/RGB.NET.Core/RGBSurfaceDeviceLoader.cs
@@ -63,7 +63,7 @@ namespace RGB.NET.Core
foreach (IRGBDevice device in Devices)
{
device.Location += new Point(posX, 0);
- posX += device.Size.Width + 1;
+ posX += device.ActualSize.Width + 1;
}
}