1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Mouse animation fixes

This commit is contained in:
SpoinkyNL 2016-07-06 20:57:01 +02:00
parent 8d9272f47c
commit 8b09e180c6
5 changed files with 17 additions and 12 deletions

View File

@ -49,11 +49,11 @@ namespace Artemis.DeviceProviders.Corsair
// Color each LED according to one of the pixels
foreach (var corsairLed in CueSDK.HeadsetSDK.Leds)
{
if (ledIndex == 0)
corsairLed.Color = bitmap.GetPixel(0, 0);
else
corsairLed.Color = bitmap.GetPixel((int) ((ledIndex + 1)*step - 1),
(int) ((ledIndex + 1)*step - 1));
var col = ledIndex == 0
? bitmap.GetPixel(0, 0)
: bitmap.GetPixel((int)((ledIndex + 1) * step - 1), (int)((ledIndex + 1) * step - 1));
corsairLed.Color = col;
ledIndex++;
}
}

View File

@ -49,11 +49,11 @@ namespace Artemis.DeviceProviders.Corsair
// Color each LED according to one of the pixels
foreach (var corsairLed in CueSDK.MouseSDK.Leds)
{
if (ledIndex == 0)
corsairLed.Color = bitmap.GetPixel(0, 0);
else
corsairLed.Color = bitmap.GetPixel((int) ((ledIndex + 1)*step - 1),
(int) ((ledIndex + 1)*step - 1));
var col = ledIndex == 0
? bitmap.GetPixel(0, 0)
: bitmap.GetPixel((int) ((ledIndex + 1)*step - 1), (int) ((ledIndex + 1)*step - 1));
corsairLed.Color = col;
ledIndex++;
}
}

View File

@ -69,6 +69,8 @@ namespace Artemis.Models
mouse = new Bitmap(40, 40);
using (var g = Graphics.FromImage(mouse))
{
// Not all SDK's handle transparency
g.Clear(Color.Black);
Profile.DrawLayers(g, renderLayers.Where(rl => rl.LayerType is MouseType), DataModel, smallRect,
false, true);
}
@ -77,6 +79,8 @@ namespace Artemis.Models
headset = new Bitmap(40, 40);
using (var g = Graphics.FromImage(headset))
{
// Not all SDK's handle transparency
g.Clear(Color.Black);
Profile.DrawLayers(g, renderLayers.Where(rl => rl.LayerType is HeadsetType), DataModel, smallRect,
false, true);
}

View File

@ -9,6 +9,7 @@ namespace Artemis.Modules.Effects.WindowsProfile
Spotify = new Spotify();
Cpu = new CpuDataModel();
Performance = new PerformanceDataModel();
CurrentTime = new CurrentTime();
}
public CpuDataModel Cpu { get; set; }
@ -17,7 +18,7 @@ namespace Artemis.Modules.Effects.WindowsProfile
public CurrentTime CurrentTime { get; set; }
}
class CurrentTime
public class CurrentTime
{
public int Hours24 { get; set; }
public int Hours12 { get; set; }

View File

@ -20,7 +20,7 @@ namespace Artemis.ViewModels.Profiles.Layers
new BindableCollection<GeneralHelpers.PropertyCollection>(GeneralHelpers.GenerateTypeMap(dataModel)),
layerModel.Properties);
SelectedLayerAnimation = LayerAnimations.FirstOrDefault(l => l.Name == layerModel.LayerAnimation.Name) ??
SelectedLayerAnimation = LayerAnimations.FirstOrDefault(l => l.Name == layerModel.LayerAnimation?.Name) ??
LayerAnimations.First(l => l.Name == "None");
}