From 977016b7434b09cc3fea1b17d27533671d7e713a Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 19 Dec 2022 11:48:37 +0200 Subject: [PATCH] scene: Change clear color in ItemRendererQPainter It makes the behavior of the ItemRendererQPainter compatible with the behavior of the ItemRendererOpenGL. It is needed to ensure that the cursor layer is properly cleared too. --- src/scene/itemrenderer_qpainter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scene/itemrenderer_qpainter.cpp b/src/scene/itemrenderer_qpainter.cpp index bceaf220a2..c6b7c4e597 100644 --- a/src/scene/itemrenderer_qpainter.cpp +++ b/src/scene/itemrenderer_qpainter.cpp @@ -41,9 +41,11 @@ void ItemRendererQPainter::endFrame() void ItemRendererQPainter::renderBackground(const QRegion ®ion) { + m_painter->setCompositionMode(QPainter::CompositionMode_Source); for (const QRect &rect : region) { - m_painter->fillRect(rect, Qt::black); + m_painter->fillRect(rect, Qt::transparent); } + m_painter->setCompositionMode(QPainter::CompositionMode_SourceOver); } void ItemRendererQPainter::renderItem(Item *item, int mask, const QRegion &_region, const WindowPaintData &data)