mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 01:58:30 +00:00
Fixed translation issue of devices not aligned to the surface origin
This commit is contained in:
parent
ac8ec602dd
commit
a3d9c6d16d
@ -240,7 +240,7 @@ namespace RGB.NET.Core
|
|||||||
if (Device.Rotation.IsRotated)
|
if (Device.Rotation.IsRotated)
|
||||||
{
|
{
|
||||||
Point deviceCenter = new Rectangle(Device.ActualSize).Center;
|
Point deviceCenter = new Rectangle(Device.ActualSize).Center;
|
||||||
Point actualDeviceCenter = Device.DeviceRectangle.Center;
|
Point actualDeviceCenter = new Rectangle(Device.DeviceRectangle.Size).Center;
|
||||||
Point centerOffset = new Point(actualDeviceCenter.X - deviceCenter.X, actualDeviceCenter.Y - deviceCenter.Y);
|
Point centerOffset = new Point(actualDeviceCenter.X - deviceCenter.X, actualDeviceCenter.Y - deviceCenter.Y);
|
||||||
|
|
||||||
actualLocation = actualLocation.Rotate(Device.Rotation, new Rectangle(Device.ActualSize).Center) + centerOffset;
|
actualLocation = actualLocation.Rotate(Device.Rotation, new Rectangle(Device.ActualSize).Center) + centerOffset;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user