[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/plasma-desktoplayout-4.2/kdelibs-plasma (silent)
From: Ambroz Bizjak <ambro () b4ever ! net>
Date: 2009-01-17 10:06:05
Message-ID: 1232186765.652722.11550.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 912313 by abizjak:
SVN_SILENT Merge upstream changes.
M +20 -10 svg.cpp
--- branches/work/plasma-desktoplayout-4.2/kdelibs-plasma/svg.cpp #912312:912313
@@ -139,6 +139,17 @@
QObject::connect(KGlobalSettings::self(), \
SIGNAL(kdisplayPaletteChanged()), q, SLOT(colorsChanged()));
}
+
+ QRectF rect;
+ bool found = Theme::defaultTheme()->findInRectsCache(path, \
"_Natural", rect); +
+ if (found && !rect.isValid()) {
+ createRenderer();
+ naturalSize = renderer->defaultSize();
+ Theme::defaultTheme()->insertIntoRectsCache(path, "_Natural", \
QRectF(QPointF(0,0), naturalSize)); + } else {
+ naturalSize = rect.size();
+ }
} else if (QFile::exists(imagePath)) {
path = imagePath;
} else {
@@ -454,6 +465,10 @@
QSize Svg::size() const
{
+ if (d->size.isEmpty()) {
+ d->size = d->naturalSize;
+ }
+
return d->size.toSize();
}
@@ -475,17 +490,12 @@
void Svg::resize()
{
- QSizeF newSize;
- if (d->renderer) {
- newSize = d->renderer->defaultSize();
- }
-
- if (qFuzzyCompare(newSize.width(), d->size.width()) &&
- qFuzzyCompare(newSize.height(), d->size.height())) {
+ if (qFuzzyCompare(d->naturalSize.width(), d->size.width()) &&
+ qFuzzyCompare(d->naturalSize.height(), d->size.height())) {
return;
}
- d->size = newSize;
+ d->size = d->naturalSize;
d->localRectCache.clear();
}
@@ -514,11 +524,11 @@
bool found = Theme::defaultTheme()->findInRectsCache(d->path, id, elementRect);
if (found) {
+ d->localRectCache.insert(id, elementRect);
return elementRect.isValid();
} else {
// kDebug() << "** ** *** !!!!!!!! *** ** ** creating renderer due to \
hasElement miss" << d->path << elementId;
- d->findAndCacheElementRect(elementId);
- return d->renderer->elementExists(elementId);
+ return d->findAndCacheElementRect(elementId).isValid();
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic