mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 21:16:24 +00:00
Added method to automatically align all loaded devices
This commit is contained in:
1 parent
851d93f40a
commit
c127002148
1 file changed
+13
@@ -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)))
|
||||
|
||||
Reference in new issue
Block a user