scene: Do not clamp 1x1 windows

Without the margins, they become 0x0 and we crash.
This commit is contained in:
Aleix Pol 2021-11-17 01:24:10 +01:00 committed by Aleix Pol Gonzalez
parent e21a3c7955
commit 19df0996f5

View file

@ -1587,6 +1587,10 @@ static void clamp_sides(int left, int width, int right, const uint32_t *src, uin
static void clamp(QImage &image, const QRect &viewport) static void clamp(QImage &image, const QRect &viewport)
{ {
Q_ASSERT(image.depth() == 32); Q_ASSERT(image.depth() == 32);
if (viewport.isEmpty()) {
image = {};
return;
}
const QRect rect = image.rect(); const QRect rect = image.rect();