Skip to content

Commit b7665b0

Browse files
authored
Merge pull request #448 from megabytesme/logitech-per-key-fix
Initialise LED layout in constructor of LogitechPerKeyRGBDevice class
2 parents 80ae628 + 66597cf commit b7665b0

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyRGBDevice.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,24 @@ internal LogitechPerKeyRGBDevice(LogitechRGBDeviceInfo info, IUpdateQueue update
2424
: base(info, updateQueue)
2525
{
2626
this._ledMapping = ledMapping;
27+
28+
InitializeLayout();
2729
}
2830

2931
#endregion
3032

3133
#region Methods
3234

35+
private void InitializeLayout()
36+
{
37+
int pos = 0;
38+
39+
foreach ((LedId ledId, LogitechLedId mapping) in _ledMapping)
40+
AddLed(ledId, new Point(pos++ * 19, 0), new Size(19, 19));
41+
}
42+
3343
/// <inheritdoc />
3444
protected override object GetLedCustomData(LedId ledId) => _ledMapping.TryGetValue(ledId, out LogitechLedId logitechLedId) ? logitechLedId : -1;
35-
45+
3646
#endregion
3747
}

0 commit comments

Comments
 (0)