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

LED visualizer - Don't attempt to render really tiny LEDs

This commit is contained in:
SpoinkyNL 2020-06-02 22:55:25 +02:00
parent 1bcee06cb2
commit 72485e5d71

View File

@ -36,6 +36,10 @@ namespace Artemis.UI.Shared.Controls
private void CreateLedGeometry()
{
// The minimum required size for geometry to be created
if (Led.RgbLed.Size.Width < 2 || Led.RgbLed.Size.Height < 2)
return;
switch (Led.RgbLed.Shape)
{
case Shape.Custom:
@ -110,7 +114,7 @@ namespace Artemis.UI.Shared.Controls
var r = Led.RgbLed.Color.GetR();
var g = Led.RgbLed.Color.GetG();
var b = Led.RgbLed.Color.GetB();
drawingContext.DrawRectangle(isDimmed
? new SolidColorBrush(Color.FromArgb(100, r, g, b))
: new SolidColorBrush(Color.FromRgb(r, g, b)), null, LedRect);