summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SharedGraphics/Painter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/SharedGraphics/Painter.cpp b/SharedGraphics/Painter.cpp
index 55e4acfb49..b6f9777320 100644
--- a/SharedGraphics/Painter.cpp
+++ b/SharedGraphics/Painter.cpp
@@ -257,7 +257,13 @@ void Painter::blit_dimmed(const Point& position, const GraphicsBitmap& source, c
for (int row = first_row; row <= last_row; ++row) {
for (int x = 0; x <= (last_column - first_column); ++x) {
- dst[x] = Color::from_rgba(src[x]).to_grayscale().darkened().value();
+ byte alpha = Color::from_rgba(src[x]).alpha();
+ if (alpha == 0xff)
+ dst[x] = Color::from_rgba(src[x]).to_grayscale().lightened().value();
+ else if (!alpha)
+ continue;
+ else
+ dst[x] = Color::from_rgba(dst[x]).blend(Color::from_rgba(src[x]).to_grayscale().lightened()).value();
}
dst += dst_skip;
src += src_skip;