Further RGB.NET updates

This commit is contained in:
Robert committed 2021-03-06 00:07:40 +01:00
1 parent 5bcba8a4a5
commit 4b914718e6
6 files changed
+15 -8

No files matched your search

@@ -49,7 +49,7 @@ namespace Artemis.Core.LayerBrushes
LedGroup.ZIndex = 1;
List<Led> missingLeds = Layer.Leds.Where(l => !LedGroup.ContainsLed(l.RgbLed)).Select(l => l.RgbLed).ToList();
List<Led> extraLeds = LedGroup.GetLeds().Where(l => Layer.Leds.All(layerLed => layerLed.RgbLed != l)).ToList();
List<Led> extraLeds = LedGroup.Where(l => Layer.Leds.All(layerLed => layerLed.RgbLed != l)).ToList();
LedGroup.AddLeds(missingLeds);
LedGroup.RemoveLeds(extraLeds);
LedGroup.Brush = GetBrush();
@@ -78,7 +78,7 @@ namespace Artemis.Core.LayerBrushes
throw new ArtemisCoreException("Cannot dispose RGB.NET layer brush because RgbService is not set");
Layer.RenderPropertiesUpdated -= LayerOnRenderPropertiesUpdated;
LedGroup?.Detach(RgbService.Surface);
LedGroup?.Detach();
LedGroup = null;
}