mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 13:06:24 +00:00
Fixed update-hooks to correctly update the surface-rectangle
This commit is contained in:
1 parent
297a4a4af9
commit
7d3ed9dcbd
1 file changed
+9
@@ -28,6 +28,7 @@ namespace RGB.NET.Core
|
|||||||
addedDevice = device;
|
addedDevice = device;
|
||||||
|
|
||||||
device.PropertyChanged += DeviceOnPropertyChanged;
|
device.PropertyChanged += DeviceOnPropertyChanged;
|
||||||
|
device.Location.PropertyChanged += DeviceLocationOnPropertyChanged;
|
||||||
_devices.Add(device);
|
_devices.Add(device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,9 +46,17 @@ namespace RGB.NET.Core
|
|||||||
{
|
{
|
||||||
SurfaceLayoutChanged?.Invoke(new SurfaceLayoutChangedEventArgs(sender as IRGBDevice, false, true));
|
SurfaceLayoutChanged?.Invoke(new SurfaceLayoutChangedEventArgs(sender as IRGBDevice, false, true));
|
||||||
UpdateSurfaceRectangle();
|
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
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user