Fixed a calculation bug while calculating the parameters for the brush calculation

This commit is contained in:
DarthAffe committed 2016-03-16 21:11:10 +01:00
1 parent 855e850ce4
commit d3103dd646
3 files changed
+13 -5

No files matched your search

+6 -1
View File
@@ -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); }