Commit 2ddf2a1d authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlProfiler: fix issues with animations in the timeline



Change-Id: Ief2351cf7d19f580c08cc557ffa0f5975e918e56
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent fea23ff5
......@@ -1360,6 +1360,8 @@ void QmlProfilerEventList::load()
rangedEvent.frameRate = attributes.value("framerate").toString().toInt();
if (attributes.hasAttribute("animationcount"))
rangedEvent.animationCount = attributes.value("animationcount").toString().toInt();
else
rangedEvent.animationCount = -1;
if (attributes.hasAttribute("eventIndex")) {
int ndx = attributes.value("eventIndex").toString().toInt();
if (!descriptionBuffer.value(ndx))
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment