From fbfde55dc23d1bc8c6ea9a563a5a478e2bccf72f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 21 Mar 2014 13:28:54 +0100 Subject: Make the cache count row lie less. The height of the events there didn't correspond to the actual cache fill state. Change-Id: I8d0415d4ec4e9e97fb1821bb8c0f5b536e21abd4 Reviewed-by: Kai Koehne --- plugins/qmlprofilerextension/pixmapcachemodel.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/plugins/qmlprofilerextension/pixmapcachemodel.cpp b/plugins/qmlprofilerextension/pixmapcachemodel.cpp index dc26db9c77..1ff6e6ab99 100644 --- a/plugins/qmlprofilerextension/pixmapcachemodel.cpp +++ b/plugins/qmlprofilerextension/pixmapcachemodel.cpp @@ -98,17 +98,10 @@ QColor PixmapCacheModel::getColor(int index) const float PixmapCacheModel::getHeight(int index) const { Q_D(const PixmapCacheModel); - if (d->range(index).pixmapEventType == PixmapCacheCountChanged) { - float scale = d->maxCacheSize - d->minCacheSize; - float fraction = 1.0f; - if (scale > 1) - fraction = (float)(d->range(index).cacheSize - - d->minCacheSize) / scale; - - return fraction * 0.85f + 0.15f; - } - - return 1.0f; + if (d->range(index).pixmapEventType == PixmapCacheCountChanged) + return 0.15 + (float)d->range(index).cacheSize * 0.85 / (float)d->maxCacheSize; + else + return 1.0f; } QString getFilenameOnly(QString absUrl) -- cgit v1.2.3