1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Fixed update-hooks to correctly update the surface-rectangle

This commit is contained in:
Darth Affe 2017-01-26 20:29:16 +01:00
parent 297a4a4af9
commit 7d3ed9dcbd

View File

@ -28,6 +28,7 @@ namespace RGB.NET.Core
addedDevice = device;
device.PropertyChanged += DeviceOnPropertyChanged;
device.Location.PropertyChanged += DeviceLocationOnPropertyChanged;
_devices.Add(device);
}
}
@ -45,9 +46,17 @@ namespace RGB.NET.Core
{
SurfaceLayoutChanged?.Invoke(new SurfaceLayoutChangedEventArgs(sender as IRGBDevice, false, true));
UpdateSurfaceRectangle();
((IRGBDevice)sender).Location.PropertyChanged += DeviceLocationOnPropertyChanged;
}
}
private static void DeviceLocationOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs)
{
SurfaceLayoutChanged?.Invoke(new SurfaceLayoutChangedEventArgs(sender as IRGBDevice, false, true));
UpdateSurfaceRectangle();
}
#endregion
}
}