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:
parent
297a4a4af9
commit
7d3ed9dcbd
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user