mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Surface editor - Improved device color overlay method
This commit is contained in:
parent
c51016f8f2
commit
f646f64648
@ -66,6 +66,7 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
|||||||
{
|
{
|
||||||
Execute.PostToUIThread(() =>
|
Execute.PostToUIThread(() =>
|
||||||
{
|
{
|
||||||
|
// TODO: Remove, frames shouldn't even be rendered if this is the case
|
||||||
if (e.Texture.Bitmap.Pixels.Length == 0)
|
if (e.Texture.Bitmap.Pixels.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -136,16 +136,15 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
|||||||
if (!ColorDevices)
|
if (!ColorDevices)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
e.Canvas.Clear(new SKColor(0, 0, 0));
|
||||||
foreach (ListDeviceViewModel listDeviceViewModel in ListDeviceViewModels)
|
foreach (ListDeviceViewModel listDeviceViewModel in ListDeviceViewModels)
|
||||||
{
|
{
|
||||||
// Order by position to accurately get the first LED
|
// 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++)
|
for (int index = 0; index < leds.Count; index++)
|
||||||
{
|
{
|
||||||
ArtemisLed artemisLed = leds[index];
|
ArtemisLed artemisLed = leds[index];
|
||||||
if (ColorFirstLedOnly && index > 0)
|
if (ColorFirstLedOnly && index == 0 || !ColorFirstLedOnly)
|
||||||
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = new SKColor(0, 0, 0)});
|
|
||||||
else
|
|
||||||
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = listDeviceViewModel.Color});
|
e.Canvas.DrawRect(artemisLed.AbsoluteRectangle, new SKPaint {Color = listDeviceViewModel.Color});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user