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

Compare commits

..

5 Commits

Author SHA1 Message Date
56d77dee35
Merge pull request #331 from diogotr7/feature/corsair-size
Corsair - Fixed corsair partial devices getting longer
2023-06-12 19:54:13 +02:00
88a0f0fa11
Merge pull request #334 from DarthAffe/razer-pids
Fixed duplicate Razer PID
2023-06-12 19:53:59 +02:00
Robert
2b203b2308 Fix duplicate 2023-06-12 19:48:52 +02:00
d7fffb4213
Added comment to new corsai FixOffsetDeviceLayout-method 2023-06-03 19:28:15 +00:00
Diogo Trindade
ca3c9fc5d3 WIP - Fixed corsair partial devices getting longer
the first device has the correct size, all following ones are larger than intended. tested with corsaid lighting node core and sp120
2023-06-03 19:44:37 +01:00
2 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native;
@ -58,6 +58,21 @@ public abstract class CorsairRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceI
Rectangle rectangle = ledPosition.ToRectangle();
AddLed(ledId, rectangle.Location, rectangle.Size);
}
if (DeviceInfo.LedOffset > 0)
FixOffsetDeviceLayout();
}
/// <summary>
/// Fixes the locations for devices split by offset by aligning them to the top left.
/// </summary>
protected virtual void FixOffsetDeviceLayout()
{
float minX = this.Min(x => x.Location.X);
float minY = this.Min(x => x.Location.Y);
foreach (Led led in this)
led.Location = led.Location.Translate(-minX, -minY);
}
protected abstract LedMapping<CorsairLedId> CreateMapping(IEnumerable<CorsairLedId> ids);

View File

@ -194,7 +194,7 @@ public sealed class RazerDeviceProvider : AbstractRGBDeviceProvider
{ 0x0083, RGBDeviceType.Mouse, "Basilisk X HyperSpeed", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0084, RGBDeviceType.Mouse, "DeathAdder V2", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0085, RGBDeviceType.Mouse, "Basilisk V2", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0085, RGBDeviceType.Mouse, "Basilisk Ultimate (Wireless)", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0086, RGBDeviceType.Mouse, "Basilisk Ultimate (Wireless)", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0088, RGBDeviceType.Mouse, "Basilisk Ultimate", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x008A, RGBDeviceType.Mouse, "Viper Mini", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x008C, RGBDeviceType.Mouse, "DeathAdder V2 Mini", LedMappings.Mouse, RazerEndpointType.Mouse },