diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-04-28 05:54:47 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-04-28 05:54:47 (GMT) |
commit | 533ad9afa7131eeca36ea499ed1e2ec97ad63c64 (patch) | |
tree | 92e41b52216f67eb801e3bb10ce397506c3139fa /src | |
parent | 5c3ec68c09f73d8b6178906884416677e8054299 (diff) | |
download | Qt-533ad9afa7131eeca36ea499ed1e2ec97ad63c64.zip Qt-533ad9afa7131eeca36ea499ed1e2ec97ad63c64.tar.gz Qt-533ad9afa7131eeca36ea499ed1e2ec97ad63c64.tar.bz2 |
Alpha needs to be part of rectangle cache key.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativerectangle.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index b21ecdc..7d499da 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -343,8 +343,9 @@ void QDeclarativeRectangle::generateRoundedRect() const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; const int radius = qCeil(d->radius); //ensure odd numbered width/height so we get 1-pixel center - QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() % QLatin1Char('_') % QString::number(radius) - % (d->pen && d->pen->isValid() ? d->pen->color().name() : QString()); + QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() % QString::number(d->color.alpha(), 16) % QLatin1Char('_') % QString::number(radius); + if (d->pen && d->pen->isValid()) + key += d->pen->color().name() % QString::number(d->pen->color().alpha(), 16); if (!QPixmapCache::find(key, &d->rectImage)) { d->rectImage = QPixmap(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2); @@ -373,8 +374,9 @@ void QDeclarativeRectangle::generateBorderedRect() if (d->rectImage.isNull()) { const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; - QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() - % (d->pen && d->pen->isValid() ? d->pen->color().name() : QString()); + QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() % QString::number(d->color.alpha(), 16); + if (d->pen && d->pen->isValid()) + key += d->pen->color().name() % QString::number(d->pen->color().alpha(), 16); if (!QPixmapCache::find(key, &d->rectImage)) { d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3); |