don't risk to mix up frames with different pixelratio

BUG:345155
Change-Id: I0b2384831d755e02b944a49259ffeacd0d2fb71e
This commit is contained in:
Marco Martin 2015-03-25 17:06:47 +01:00
parent 3516c04006
commit 285224a2ea
3 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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;

View File

@ -709,6 +709,10 @@ void Svg::setDevicePixelRatio(qreal ratio)
return;
}
if (FrameSvg *f = qobject_cast<FrameSvg *>(this)) {
f->clearCache();
}
d->devicePixelRatio = floor(ratio);
emit repaintNeeded();