1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 17:53:32 +00:00

Device properties - Changed doubles to floats for RGB.NET update

This commit is contained in:
Robert 2021-03-05 16:18:12 +01:00
parent da90c0d3a1
commit 5bcba8a4a5

View File

@ -16,16 +16,16 @@ namespace Artemis.UI.Screens.Settings.Device.Tabs
private readonly ICoreService _coreService; private readonly ICoreService _coreService;
private readonly IMessageService _messageService; private readonly IMessageService _messageService;
private readonly IRgbService _rgbService; private readonly IRgbService _rgbService;
private double _blueScale; private float _blueScale;
private SKColor _currentColor; private SKColor _currentColor;
private bool _displayOnDevices; private bool _displayOnDevices;
private double _greenScale; private float _greenScale;
private double _initialBlueScale; private float _initialBlueScale;
private double _initialGreenScale; private float _initialGreenScale;
private double _initialRedScale; private float _initialRedScale;
private double _redScale; private float _redScale;
private int _rotation; private int _rotation;
private double _scale; private float _scale;
private int _x; private int _x;
private int _y; private int _y;
@ -57,7 +57,7 @@ namespace Artemis.UI.Screens.Settings.Device.Tabs
set => SetAndNotify(ref _y, value); set => SetAndNotify(ref _y, value);
} }
public double Scale public float Scale
{ {
get => _scale; get => _scale;
set => SetAndNotify(ref _scale, value); set => SetAndNotify(ref _scale, value);
@ -69,19 +69,19 @@ namespace Artemis.UI.Screens.Settings.Device.Tabs
set => SetAndNotify(ref _rotation, value); set => SetAndNotify(ref _rotation, value);
} }
public double RedScale public float RedScale
{ {
get => _redScale; get => _redScale;
set => SetAndNotify(ref _redScale, value); set => SetAndNotify(ref _redScale, value);
} }
public double GreenScale public float GreenScale
{ {
get => _greenScale; get => _greenScale;
set => SetAndNotify(ref _greenScale, value); set => SetAndNotify(ref _greenScale, value);
} }
public double BlueScale public float BlueScale
{ {
get => _blueScale; get => _blueScale;
set => SetAndNotify(ref _blueScale, value); set => SetAndNotify(ref _blueScale, value);
@ -101,9 +101,9 @@ namespace Artemis.UI.Screens.Settings.Device.Tabs
public void ApplyScaling() public void ApplyScaling()
{ {
Device.RedScale = RedScale / 100d; Device.RedScale = RedScale / 100f;
Device.GreenScale = GreenScale / 100d; Device.GreenScale = GreenScale / 100f;
Device.BlueScale = BlueScale / 100d; Device.BlueScale = BlueScale / 100f;
} }
public void BrowseCustomLayout(object sender, MouseEventArgs e) public void BrowseCustomLayout(object sender, MouseEventArgs e)
@ -139,9 +139,9 @@ namespace Artemis.UI.Screens.Settings.Device.Tabs
Device.Y = Y; Device.Y = Y;
Device.Scale = Scale; Device.Scale = Scale;
Device.Rotation = Rotation; Device.Rotation = Rotation;
Device.RedScale = RedScale / 100d; Device.RedScale = RedScale / 100f;
Device.GreenScale = GreenScale / 100d; Device.GreenScale = GreenScale / 100f;
Device.BlueScale = BlueScale / 100d; Device.BlueScale = BlueScale / 100f;
_coreService.ModuleRenderingDisabled = false; _coreService.ModuleRenderingDisabled = false;
} }
@ -159,9 +159,9 @@ namespace Artemis.UI.Screens.Settings.Device.Tabs
Y = (int) Device.Y; Y = (int) Device.Y;
Scale = Device.Scale; Scale = Device.Scale;
Rotation = (int) Device.Rotation; Rotation = (int) Device.Rotation;
RedScale = Device.RedScale * 100d; RedScale = Device.RedScale * 100f;
GreenScale = Device.GreenScale * 100d; GreenScale = Device.GreenScale * 100f;
BlueScale = Device.BlueScale * 100d; BlueScale = Device.BlueScale * 100f;
//we need to store the initial values to be able to restore them when the user clicks "Cancel" //we need to store the initial values to be able to restore them when the user clicks "Cancel"
_initialRedScale = Device.RedScale; _initialRedScale = Device.RedScale;
_initialGreenScale = Device.GreenScale; _initialGreenScale = Device.GreenScale;