QmlProfiler: fix issues with animations in the timeline

Change-Id: Ief2351cf7d19f580c08cc557ffa0f5975e918e56
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2012-01-10 17:31:04 +01:00
parent fea23ff5a1
commit 2ddf2a1d81
2 changed files with 7 additions and 3 deletions

View File

@@ -145,9 +145,11 @@ void TimelineView::drawItemsToPainter(QPainter *p, int fromIndex, int toIndex)
// special: animations
if (eventType == 0 && m_eventList->getAnimationCount(i) >= 0) {
double scale = m_eventList->getMaximumAnimationCount() - m_eventList->getMinimumAnimationCount();
if (scale < 1)
scale = 1;
double fraction = (double)(m_eventList->getAnimationCount(i) - m_eventList->getMinimumAnimationCount()) / scale;
double fraction;
if (scale > 1)
fraction = (double)(m_eventList->getAnimationCount(i) - m_eventList->getMinimumAnimationCount()) / scale;
else
fraction = 1.0;
height = DefaultRowHeight * (fraction * 0.85 + 0.15);
y += DefaultRowHeight - height;