1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2026-03-23 23:38:45 +00:00

Merge pull request #448 from megabytesme/logitech-per-key-fix

Initialise LED layout in constructor of LogitechPerKeyRGBDevice class
This commit is contained in:
DarthAffe 2026-03-19 22:50:11 +01:00 committed by GitHub
commit b7665b00e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,14 +24,24 @@ public sealed class LogitechPerKeyRGBDevice : LogitechRGBDevice<LogitechRGBDevic
: base(info, updateQueue)
{
this._ledMapping = ledMapping;
InitializeLayout();
}
#endregion
#region Methods
private void InitializeLayout()
{
int pos = 0;
foreach ((LedId ledId, LogitechLedId mapping) in _ledMapping)
AddLed(ledId, new Point(pos++ * 19, 0), new Size(19, 19));
}
/// <inheritdoc />
protected override object GetLedCustomData(LedId ledId) => _ledMapping.TryGetValue(ledId, out LogitechLedId logitechLedId) ? logitechLedId : -1;
#endregion
}