1
0
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:
Darth Affe 2019-11-21 00:09:21 +01:00
parent ac8ec602dd
commit a3d9c6d16d

View File

@ -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;