Fix clipped shadows on useraction menus, when wayland and desktop scaling is enabled.

This commit is contained in:
Andreas Haratzis 2020-07-11 17:04:56 -07:00 committed by Vlad Zahorodnii
parent 51f926c065
commit 159fbc5ec4
2 changed files with 17 additions and 17 deletions

View file

@ -2471,17 +2471,17 @@ bool SceneOpenGLShadow::prepareBackend()
QPainter p;
p.begin(&image);
p.drawPixmap(0, 0, shadowPixmap(ShadowElementTopLeft));
p.drawPixmap(innerRectLeft, 0, shadowPixmap(ShadowElementTop));
p.drawPixmap(width - topRight.width(), 0, shadowPixmap(ShadowElementTopRight));
p.drawPixmap(0, 0, topLeft.width(), topLeft.height(), shadowPixmap(ShadowElementTopLeft));
p.drawPixmap(innerRectLeft, 0, top.width(), top.height(), shadowPixmap(ShadowElementTop));
p.drawPixmap(width - topRight.width(), 0, topRight.width(), topRight.height(), shadowPixmap(ShadowElementTopRight));
p.drawPixmap(0, innerRectTop, shadowPixmap(ShadowElementLeft));
p.drawPixmap(width - right.width(), innerRectTop, shadowPixmap(ShadowElementRight));
p.drawPixmap(0, height - bottomLeft.height(), shadowPixmap(ShadowElementBottomLeft));
p.drawPixmap(innerRectLeft, height - bottom.height(), shadowPixmap(ShadowElementBottom));
p.drawPixmap(width - bottomRight.width(), height - bottomRight.height(), shadowPixmap(ShadowElementBottomRight));
p.drawPixmap(0, innerRectTop, left.width(), left.height(), shadowPixmap(ShadowElementLeft));
p.drawPixmap(width - right.width(), innerRectTop, right.width(), right.height(), shadowPixmap(ShadowElementRight));
p.drawPixmap(0, height - bottomLeft.height(), bottomLeft.width(), bottomLeft.height(), shadowPixmap(ShadowElementBottomLeft));
p.drawPixmap(innerRectLeft, height - bottom.height(), bottom.width(), bottom.height(), shadowPixmap(ShadowElementBottom));
p.drawPixmap(width - bottomRight.width(), height - bottomRight.height(), bottomRight.width(), bottomRight.height(), shadowPixmap(ShadowElementBottomRight));
p.end();
// Check if the image is alpha-only in practice, and if so convert it to an 8-bpp format

View file

@ -764,14 +764,14 @@ bool SceneQPainterShadow::prepareBackend()
QPainter painter;
painter.begin(&image);
painter.drawPixmap(0, 0, topLeft);
painter.drawPixmap(topLeft.width(), 0, top);
painter.drawPixmap(width - topRight.width(), 0, topRight);
painter.drawPixmap(0, height - bottomLeft.height(), bottomLeft);
painter.drawPixmap(bottomLeft.width(), height - bottom.height(), bottom);
painter.drawPixmap(width - bottomRight.width(), height - bottomRight.height(), bottomRight);
painter.drawPixmap(0, topLeft.height(), left);
painter.drawPixmap(width - right.width(), topRight.height(), right);
painter.drawPixmap(0, 0, topLeft.width(), topLeft.height(), topLeft);
painter.drawPixmap(topLeft.width(), 0, top.width(), top.height(), top);
painter.drawPixmap(width - topRight.width(), 0, topRight.width(), topRight.height(), topRight);
painter.drawPixmap(0, height - bottomLeft.height(), bottomLeft.width(), bottomLeft.height(), bottomLeft);
painter.drawPixmap(bottomLeft.width(), height - bottom.height(), bottom.width(), bottom.height(), bottom);
painter.drawPixmap(width - bottomRight.width(), height - bottomRight.height(), bottomRight.width(), bottomRight.height(), bottomRight);
painter.drawPixmap(0, topLeft.height(), left.width(), left.height(), left);
painter.drawPixmap(width - right.width(), topRight.height(), right.width(), right.height(), right);
painter.end();
m_texture = image;