From ae5a84cd6c1c43a4f60ad1bf078e6f31c450f9bc Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 6 Jun 2021 07:39:17 +0200 Subject: [PATCH] Fix drawBitmapPatternPie() Masks are stored in 8-bit format, but drawAlphaPixel() uses only 4-bit alpha. --- radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp index 2e29f857e..2dea49fd1 100755 --- a/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp +++ b/radio/src/thirdparty/libopenui/src/bitmapbuffer.cpp @@ -755,16 +755,16 @@ void BitmapBuffer::drawBitmapPatternPie(coord_t x, coord_t y, const uint8_t * im for (int x1 = w2 - 1; x1 >= 0; x1--) { Slope slope(false, x1 == 0 ? 99000 : y1 * 100 / x1); if (slope.isBetween(startSlope, endSlope)) { - drawAlphaPixel(x + w2 + x1, y + h2 - y1, q[(h2 - y1) * width + w2 + x1], color); + drawAlphaPixel(x + w2 + x1, y + h2 - y1, q[(h2 - y1) * width + w2 + x1]>>4, color); } if (slope.invertVertical().isBetween(startSlope, endSlope)) { - drawAlphaPixel(x + w2 + x1, y + h2 + y1, q[(h2 + y1) * width + w2 + x1], color); + drawAlphaPixel(x + w2 + x1, y + h2 + y1, q[(h2 + y1) * width + w2 + x1]>>4, color); } if (slope.invertHorizontal().isBetween(startSlope, endSlope)) { - drawAlphaPixel(x + w2 - x1, y + h2 + y1, q[(h2 + y1) * width + w2 - x1], color); + drawAlphaPixel(x + w2 - x1, y + h2 + y1, q[(h2 + y1) * width + w2 - x1]>>4, color); } if (slope.invertVertical().isBetween(startSlope, endSlope)) { - drawAlphaPixel(x + w2 - x1, y + h2 - y1, q[(h2 - y1) * width + w2 - x1], color); + drawAlphaPixel(x + w2 - x1, y + h2 - y1, q[(h2 - y1) * width + w2 - x1]>>4, color); } } }