forked from qt-creator/qt-creator
QmlProfiler: fix issues with animations in the timeline
Change-Id: Ief2351cf7d19f580c08cc557ffa0f5975e918e56 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user