From 62e2655b725d0a4af43f147063bdbea2aa05e6b1 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Sat, 5 Feb 2022 14:50:09 +0100 Subject: [PATCH] GuiSwitch: Do not draw onImg and offImg when not visible (#11) Co-authored-by: Maschell --- source/gui/GuiSwitch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/gui/GuiSwitch.cpp b/source/gui/GuiSwitch.cpp index c396654..2fb0399 100644 --- a/source/gui/GuiSwitch.cpp +++ b/source/gui/GuiSwitch.cpp @@ -63,6 +63,10 @@ void GuiSwitch::setImageHighlighted(GuiImage *img) { } void GuiSwitch::draw(CVideo *v) { + if (!this->isVisible()) { + return; + } + GuiToggle::draw(v); if (getValue()) { if (onImg != NULL) {