diff --git a/src/plasma/framesvg.cpp b/src/plasma/framesvg.cpp index e4093d7e3..f9379b075 100644 --- a/src/plasma/framesvg.cpp +++ b/src/plasma/framesvg.cpp @@ -236,6 +236,9 @@ void FrameSvg::setElementPrefix(const QString &prefix) if (!oldFrameData->frameSize.isEmpty()) { const QString key = d->cacheId(oldFrameData, d->prefix); newFd = FrameSvgPrivate::s_sharedFrames[theme()->d].value(key); + if (newFd && newFd->devicePixelRatio != devicePixelRatio()) { + newFd = 0; + } } // we need to put this in the cache if we didn't find it in the shared frames diff --git a/src/plasma/private/framesvg_p.h b/src/plasma/private/framesvg_p.h index 560e1b21c..beee956d4 100644 --- a/src/plasma/private/framesvg_p.h +++ b/src/plasma/private/framesvg_p.h @@ -68,6 +68,7 @@ public: leftMargin(0), rightMargin(0), bottomMargin(0), + devicePixelRatio(svg->devicePixelRatio()), noBorderPadding(false), stretchBorders(false), tileCenter(false), @@ -116,6 +117,8 @@ public: int fixedRightMargin; int fixedBottomMargin; + qreal devicePixelRatio; + //size of the svg where the size of the "center" //element is contentWidth x contentHeight bool noBorderPadding : 1; diff --git a/src/plasma/svg.cpp b/src/plasma/svg.cpp index 2cb6472d2..21937c5e4 100644 --- a/src/plasma/svg.cpp +++ b/src/plasma/svg.cpp @@ -709,6 +709,10 @@ void Svg::setDevicePixelRatio(qreal ratio) return; } + if (FrameSvg *f = qobject_cast(this)) { + f->clearCache(); + } + d->devicePixelRatio = floor(ratio); emit repaintNeeded();