diff --git a/RGB.NET.Core/RGBSurfaceDeviceLoader.cs b/RGB.NET.Core/RGBSurfaceDeviceLoader.cs index aa0ec63..ebe0ef6 100644 --- a/RGB.NET.Core/RGBSurfaceDeviceLoader.cs +++ b/RGB.NET.Core/RGBSurfaceDeviceLoader.cs @@ -42,6 +42,19 @@ namespace RGB.NET.Core } } + /// + /// Automatically aligns all devices to prevent overlaps. + /// + public void AlignDevies() + { + double posX = 0; + foreach (IRGBDevice device in Devices) + { + device.Location.X = posX; + posX += device.Size.Width + 1; + } + } + private void DeviceOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { if (string.Equals(propertyChangedEventArgs.PropertyName, nameof(IRGBDevice.Location)))