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() ...@@ -1360,6 +1360,8 @@ void QmlProfilerEventList::load()
rangedEvent.frameRate = attributes.value("framerate").toString().toInt(); rangedEvent.frameRate = attributes.value("framerate").toString().toInt();
if (attributes.hasAttribute("animationcount")) if (attributes.hasAttribute("animationcount"))
rangedEvent.animationCount = attributes.value("animationcount").toString().toInt(); rangedEvent.animationCount = attributes.value("animationcount").toString().toInt();
else
rangedEvent.animationCount = -1;
if (attributes.hasAttribute("eventIndex")) { if (attributes.hasAttribute("eventIndex")) {
int ndx = attributes.value("eventIndex").toString().toInt(); int ndx = attributes.value("eventIndex").toString().toInt();
if (!descriptionBuffer.value(ndx)) if (!descriptionBuffer.value(ndx))
......
...@@ -145,9 +145,11 @@ void TimelineView::drawItemsToPainter(QPainter *p, int fromIndex, int toIndex) ...@@ -145,9 +145,11 @@ void TimelineView::drawItemsToPainter(QPainter *p, int fromIndex, int toIndex)
// special: animations // special: animations
if (eventType == 0 && m_eventList->getAnimationCount(i) >= 0) { if (eventType == 0 && m_eventList->getAnimationCount(i) >= 0) {
double scale = m_eventList->getMaximumAnimationCount() - m_eventList->getMinimumAnimationCount(); double scale = m_eventList->getMaximumAnimationCount() - m_eventList->getMinimumAnimationCount();
if (scale < 1) double fraction;
scale = 1; if (scale > 1)
double fraction = (double)(m_eventList->getAnimationCount(i) - m_eventList->getMinimumAnimationCount()) / scale; fraction = (double)(m_eventList->getAnimationCount(i) - m_eventList->getMinimumAnimationCount()) / scale;
else
fraction = 1.0;
height = DefaultRowHeight * (fraction * 0.85 + 0.15); height = DefaultRowHeight * (fraction * 0.85 + 0.15);
y += DefaultRowHeight - height; 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