1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 16:58:29 +00:00

Moved brush calculation mode to the brush

This makes obviously more sense ...
This commit is contained in:
Darth Affe 2016-03-27 17:57:13 +02:00
parent 286a6ea284
commit a783e52c41
3 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,7 @@
// ReSharper disable VirtualMemberNeverOverriden.Global
using System.Drawing;
using CUE.NET.Devices.Keyboard.Enums;
using CUE.NET.Helper;
namespace CUE.NET.Brushes
@ -12,6 +13,11 @@ namespace CUE.NET.Brushes
{
#region Properties & Fields
/// <summary>
/// Gets or sets the calculation mode used for the rectangle/points used for color-selection in brushes.
/// </summary>
public BrushCalculationMode BrushCalculationMode { get; set; } = BrushCalculationMode.Relative;
/// <summary>
/// Gets or sets the overall percentage brightness of the brush.
/// </summary>

View File

@ -1,6 +1,7 @@
// ReSharper disable UnusedMemberInSuper.Global
using System.Drawing;
using CUE.NET.Devices.Keyboard.Enums;
namespace CUE.NET.Brushes
{
@ -9,6 +10,11 @@ namespace CUE.NET.Brushes
/// </summary>
public interface IBrush
{
/// <summary>
/// Gets or sets the calculation mode used for the rectangle/points used for color-selection in brushes.
/// </summary>
BrushCalculationMode BrushCalculationMode { get; set; }
/// <summary>
/// Gets or sets the overall percentage brightness of the brush.
/// </summary>

View File

@ -106,11 +106,6 @@ namespace CUE.NET.Devices.Keyboard
/// </summary>
public int ZIndex { get; set; } = 0;
/// <summary>
/// Gets or sets the calculation mode used for the rectangle/points used for color-selection in brushes.
/// </summary>
public BrushCalculationMode BrushCalculationMode { get; set; } = BrushCalculationMode.Relative;
/// <summary>
/// Gets a value indicating if the keyboard has an active effect to deal with or not.
/// </summary>
@ -175,7 +170,7 @@ namespace CUE.NET.Devices.Keyboard
{
try
{
switch (BrushCalculationMode)
switch (brush.BrushCalculationMode)
{
case BrushCalculationMode.Relative:
RectangleF brushRectangle = RectangleHelper.CreateRectangleFromRectangles(keys.Select(x => x.KeyRectangle));