mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-11 13:06:24 +00:00
Fixed a calculation bug while calculating the parameters for the brush calculation
This commit is contained in:
1 parent
855e850ce4
commit
d3103dd646
3 files changed
+13
-5
No files matched your search
@@ -179,8 +179,13 @@ namespace CUE.NET.Devices.Keyboard
|
||||
try
|
||||
{
|
||||
RectangleF brushRectangle = RectangleHelper.CreateRectangleFromRectangles(keys.Select(x => x.KeyRectangle));
|
||||
//TODO DarthAffe 16.03.2016: Rework brushes and replace this workaround with a proper selection of absolute/relative calculations
|
||||
float offsetX = -brushRectangle.X;
|
||||
float offsetY = -brushRectangle.Y;
|
||||
brushRectangle.X = 0;
|
||||
brushRectangle.Y = 0;
|
||||
foreach (CorsairKey key in keys)
|
||||
key.Led.Color = brush.GetColorAtPoint(brushRectangle, key.KeyRectangle.GetCenter());
|
||||
key.Led.Color = brush.GetColorAtPoint(brushRectangle, key.KeyRectangle.GetCenter(offsetX, offsetY));
|
||||
}
|
||||
// ReSharper disable once CatchAllClause
|
||||
catch (Exception ex) { ManageException(ex); }
|
||||
|
||||
Reference in new issue
Block a user