Surface editor - Improved device color overlay method

This commit is contained in:
Robert committed 2021-03-16 00:15:50 +01:00
1 parent c51016f8f2
commit f646f64648
2 files changed
+4 -4

No files matched your search

@@ -66,6 +66,7 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
{
Execute.PostToUIThread(() =>
{
// TODO: Remove, frames shouldn't even be rendered if this is the case
if (e.Texture.Bitmap.Pixels.Length == 0)
return;
@@ -136,16 +136,15 @@ namespace Artemis.UI.Screens.SurfaceEditor
if (!ColorDevices)
return;
e.Canvas.Clear(new SKColor(0, 0, 0));
foreach (ListDeviceViewModel listDeviceViewModel in ListDeviceViewModels)
{
// Order by position to accurately get the first LED
List<ArtemisLed> leds = listDeviceViewModel.Device.Leds.OrderBy(l => l.Rectangle.Left).ThenBy(l => l.Rectangle.Top).ToList();
List<ArtemisLed> leds = listDeviceViewModel.Device.Leds.OrderBy(l => l.RgbLed.Location.Y).ThenBy(l => l.RgbLed.Location.X).ToList();
for (int index = 0; index < leds.Count; index++)
{
ArtemisLed artemisLed = leds[index];
if (ColorFirstLedOnly && index > 0)
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = new SKColor(0, 0, 0)});
else
if (ColorFirstLedOnly && index == 0 || !ColorFirstLedOnly)
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = listDeviceViewModel.Color});
}
}