don't risk to mix up frames with different pixelratio
BUG:345155 Change-Id: I0b2384831d755e02b944a49259ffeacd0d2fb71e
This commit is contained in:
parent
3516c04006
commit
285224a2ea
@ -236,6 +236,9 @@ void FrameSvg::setElementPrefix(const QString &prefix)
|
|||||||
if (!oldFrameData->frameSize.isEmpty()) {
|
if (!oldFrameData->frameSize.isEmpty()) {
|
||||||
const QString key = d->cacheId(oldFrameData, d->prefix);
|
const QString key = d->cacheId(oldFrameData, d->prefix);
|
||||||
newFd = FrameSvgPrivate::s_sharedFrames[theme()->d].value(key);
|
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
|
// we need to put this in the cache if we didn't find it in the shared frames
|
||||||
|
@ -68,6 +68,7 @@ public:
|
|||||||
leftMargin(0),
|
leftMargin(0),
|
||||||
rightMargin(0),
|
rightMargin(0),
|
||||||
bottomMargin(0),
|
bottomMargin(0),
|
||||||
|
devicePixelRatio(svg->devicePixelRatio()),
|
||||||
noBorderPadding(false),
|
noBorderPadding(false),
|
||||||
stretchBorders(false),
|
stretchBorders(false),
|
||||||
tileCenter(false),
|
tileCenter(false),
|
||||||
@ -116,6 +117,8 @@ public:
|
|||||||
int fixedRightMargin;
|
int fixedRightMargin;
|
||||||
int fixedBottomMargin;
|
int fixedBottomMargin;
|
||||||
|
|
||||||
|
qreal devicePixelRatio;
|
||||||
|
|
||||||
//size of the svg where the size of the "center"
|
//size of the svg where the size of the "center"
|
||||||
//element is contentWidth x contentHeight
|
//element is contentWidth x contentHeight
|
||||||
bool noBorderPadding : 1;
|
bool noBorderPadding : 1;
|
||||||
|
@ -709,6 +709,10 @@ void Svg::setDevicePixelRatio(qreal ratio)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FrameSvg *f = qobject_cast<FrameSvg *>(this)) {
|
||||||
|
f->clearCache();
|
||||||
|
}
|
||||||
|
|
||||||
d->devicePixelRatio = floor(ratio);
|
d->devicePixelRatio = floor(ratio);
|
||||||
|
|
||||||
emit repaintNeeded();
|
emit repaintNeeded();
|
||||||
|
Loading…
Reference in New Issue
Block a user