From 4898a0429d8b34f5e27ea4101bbe23b11f5c33c6 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Fri, 20 Mar 2020 11:39:58 +0100 Subject: [PATCH] TransparentBufferedWindow fix --- radio/src/thirdparty/libopenui/src/bufferedwindow.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/bufferedwindow.h b/radio/src/thirdparty/libopenui/src/bufferedwindow.h index 74aa70e24..6e6aa4a2c 100644 --- a/radio/src/thirdparty/libopenui/src/bufferedwindow.h +++ b/radio/src/thirdparty/libopenui/src/bufferedwindow.h @@ -82,8 +82,13 @@ class TransparentBufferedWindow: public BufferedWindow if (this->paintUpdateNeeded) { this->paintUpdate(dc); - this->bitmap->drawBitmap(0, 0, dc, dc->getOffsetX(), dc->getOffsetY()); - this->paintUpdateNeeded = false; + // we can only store the bitmap if fully drawn + coord_t xmin, xmax, ymin, ymax; + dc->getClippingRect(xmin, xmax, ymin, ymax); + if (xmax - xmin >= this->width() && ymax - ymin >= this->height()) { + this->bitmap->drawBitmap(0, 0, dc, dc->getOffsetX(), dc->getOffsetY()); + this->paintUpdateNeeded = false; + } } else { dc->drawBitmap(0, 0, this->bitmap);