TransparentBufferedWindow fix

This commit is contained in:
Bertrand Songis
2020-03-20 11:39:58 +01:00
parent 6f646c78e6
commit 4898a0429d
+7 -2
View File
@@ -82,8 +82,13 @@ class TransparentBufferedWindow: public BufferedWindow<T>
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);