mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 01:58:30 +00:00
Added method to automatically align all loaded devices
This commit is contained in:
parent
851d93f40a
commit
c127002148
@ -42,6 +42,19 @@ namespace RGB.NET.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automatically aligns all devices to prevent overlaps.
|
||||
/// </summary>
|
||||
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)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user