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