Commit b68a93ef authored by Niccolò Venerandi's avatar Niccolò Venerandi Committed by Nate Graham
Browse files

Make the panel's corner mask 1px smaller to avoid artifacts at the corners

This effectively applies the fix in
frameworks/plasma-framework!377 to
panels as well.

BUG:417511
FIXED-IN: 5.26.1


(cherry picked from commit 999c3a0f)
parent 735f350c
Pipeline #247874 passed with stage
in 19 minutes and 34 seconds
......@@ -1171,9 +1171,16 @@ void PanelView::updateMask()
if (rootObject) {
const QVariant maskProperty = rootObject->property("panelMask");
if (static_cast<QMetaType::Type>(maskProperty.type()) == QMetaType::QRegion) {
mask = maskProperty.value<QRegion>();
mask.translate(rootObject->property("maskOffsetX").toInt(),
rootObject->property("maskOffsetY").toInt());
QRegion rawMask = maskProperty.value<QRegion>();
rawMask.translate(rootObject->property("maskOffsetX").toInt(),
rootObject->property("maskOffsetY").toInt());
// This makes the mask slightly smaller than the frame. Since the svg will have antialiasing and the mask not,
// there will be artifacts at the corners. I make the mask smaller by moving by 1px in each direction and
// then intersecting.
mask = rawMask.translated(1, 1);
mask = mask.intersected(rawMask.translated(-1, 1));
mask = mask.intersected(rawMask.translated(-1, -1));
mask = mask.intersected(rawMask.translated(1, -1));
}
}
KWindowEffects::enableBlurBehind(this, m_theme.blurBehindEnabled(), mask);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment