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:
parent
1bcee06cb2
commit
72485e5d71
@ -36,6 +36,10 @@ namespace Artemis.UI.Shared.Controls
|
|||||||
|
|
||||||
private void CreateLedGeometry()
|
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)
|
switch (Led.RgbLed.Shape)
|
||||||
{
|
{
|
||||||
case Shape.Custom:
|
case Shape.Custom:
|
||||||
@ -110,7 +114,7 @@ namespace Artemis.UI.Shared.Controls
|
|||||||
var r = Led.RgbLed.Color.GetR();
|
var r = Led.RgbLed.Color.GetR();
|
||||||
var g = Led.RgbLed.Color.GetG();
|
var g = Led.RgbLed.Color.GetG();
|
||||||
var b = Led.RgbLed.Color.GetB();
|
var b = Led.RgbLed.Color.GetB();
|
||||||
|
|
||||||
drawingContext.DrawRectangle(isDimmed
|
drawingContext.DrawRectangle(isDimmed
|
||||||
? new SolidColorBrush(Color.FromArgb(100, r, g, b))
|
? new SolidColorBrush(Color.FromArgb(100, r, g, b))
|
||||||
: new SolidColorBrush(Color.FromRgb(r, g, b)), null, LedRect);
|
: new SolidColorBrush(Color.FromRgb(r, g, b)), null, LedRect);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user