mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-12 16:58:29 +00:00
Fixed wrong device-rectangle initialize
This commit is contained in:
parent
69a9a122d0
commit
c611675355
@ -37,7 +37,7 @@ namespace CUE.NET.Devices.Generic
|
||||
/// <summary>
|
||||
/// Gets the rectangle containing all LEDs of the device.
|
||||
/// </summary>
|
||||
public RectangleF DeviceRectangle { get; }
|
||||
public RectangleF DeviceRectangle { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a dictionary containing all LEDs of the device.
|
||||
@ -139,8 +139,6 @@ namespace CUE.NET.Devices.Generic
|
||||
protected AbstractCueDevice(IDeviceInfo info)
|
||||
{
|
||||
this.DeviceInfo = info;
|
||||
|
||||
DeviceRectangle = RectangleHelper.CreateRectangleFromRectangles((this).Select(x => x.LedRectangle));
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -152,7 +150,10 @@ namespace CUE.NET.Devices.Generic
|
||||
/// <summary>
|
||||
/// Initializes the device.
|
||||
/// </summary>
|
||||
public abstract void Initialize();
|
||||
public virtual void Initialize()
|
||||
{
|
||||
DeviceRectangle = RectangleHelper.CreateRectangleFromRectangles((this).Select(x => x.LedRectangle));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the LED-Object with the specified id.
|
||||
|
||||
@ -45,6 +45,8 @@ namespace CUE.NET.Devices.Headset
|
||||
{
|
||||
InitializeLed(CorsairHeadsetLedId.LeftLogo, new RectangleF(0, 0, 1, 1));
|
||||
InitializeLed(CorsairHeadsetLedId.RightLogo, new RectangleF(1, 0, 1, 1));
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -77,6 +77,8 @@ namespace CUE.NET.Devices.Keyboard
|
||||
|
||||
ptr = new IntPtr(ptr.ToInt64() + structSize);
|
||||
}
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -67,6 +67,8 @@ namespace CUE.NET.Devices.Mouse
|
||||
default:
|
||||
throw new WrapperException($"Can't initial mouse with layout '{MouseDeviceInfo.PhysicalLayout}'");
|
||||
}
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -82,6 +82,8 @@ namespace CUE.NET.Devices.Mousemat
|
||||
// Sort for easy iteration by clients
|
||||
foreach (_CorsairLedPosition ledPosition in positions.OrderBy(p => p.ledId))
|
||||
InitializeLed(ledPosition.ledId, new RectangleF((float)ledPosition.left, (float)ledPosition.top, (float)ledPosition.width, (float)ledPosition.height));
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user