From 184ca0bc5caf698771554ae318f47fb0c82e6b35 Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Tue, 3 Oct 2023 11:23:58 +0200 Subject: [PATCH] Don't draw transparent pixels Signed-off-by: Thomas Rohloff --- source/utils/DrawUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/utils/DrawUtils.cpp b/source/utils/DrawUtils.cpp index ca8ef4c..2c438da 100644 --- a/source/utils/DrawUtils.cpp +++ b/source/utils/DrawUtils.cpp @@ -60,6 +60,10 @@ void DrawUtils::clear(Color col) { } void DrawUtils::drawPixel(uint32_t x, uint32_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + if (a == 0) { + return; + } + float opacity = a / 255.0f; // put pixel in the drc buffer