Fixed leds not updating

This commit is contained in:
DarthAffe committed 2021-03-05 22:59:09 +01:00
1 parent 438e5c576a
commit e6290ae480
2 files changed
+5 -4

No files matched your search

+5 -1
View File
@@ -90,10 +90,14 @@ namespace RGB.NET.Core
// Send LEDs to SDK // Send LEDs to SDK
List<Led> ledsToUpdate = GetLedsToUpdate(flushLeds).ToList(); List<Led> ledsToUpdate = GetLedsToUpdate(flushLeds).ToList();
foreach (Led led in ledsToUpdate)
led.Update();
UpdateLeds(ledsToUpdate); UpdateLeds(ledsToUpdate);
} }
protected virtual IEnumerable<Led> GetLedsToUpdate(bool flushLeds) => ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)).Where(led => led.Color.A > 0); protected virtual IEnumerable<Led> GetLedsToUpdate(bool flushLeds) => ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)).Where(led => led.RequestedColor?.A > 0);
protected virtual IEnumerable<(object key, Color color)> GetUpdateData(IEnumerable<Led> leds) protected virtual IEnumerable<(object key, Color color)> GetUpdateData(IEnumerable<Led> leds)
{ {
if (ColorCorrections.Count > 0) if (ColorCorrections.Count > 0)
-3
View File
@@ -165,9 +165,6 @@ namespace RGB.NET.Core
try { device.Update(flushLeds); } try { device.Update(flushLeds); }
catch (Exception ex) { OnException(ex); } catch (Exception ex) { OnException(ex); }
foreach (Led led in Leds)
led.Update();
OnUpdated(); OnUpdated();
} }
} }