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

Fixed leds not updating

This commit is contained in:
Darth Affe 2021-03-05 22:59:09 +01:00
parent 438e5c576a
commit e6290ae480
2 changed files with 5 additions and 4 deletions

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)

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();
} }
} }