QmlProfiler: Don't needlessly interrupt the timeline flicking motion

If the timeline is being flicked and we manually set contentX from the
zoomControl callback it will stop. That's unnecessary as the flicking
itself will trigger further updates to zoomControl.

Change-Id: Id14bde1bb33d6b1f6d719a41df23074981e474da
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-03-05 16:47:39 +01:00
parent 2c9eb19a39
commit f696d01e72

View File

@@ -341,10 +341,12 @@ Rectangle {
if (start !== startTime || end !== endTime) {
startTime = start;
endTime = end;
var newStartX = (startTime - qmlProfilerModelProxy.traceStartTime()) *
flick.width / (endTime-startTime);
if (isFinite(newStartX) && Math.abs(newStartX - flick.contentX) >= 1)
flick.contentX = newStartX;
if (!flick.flickingHorizontally) {
var newStartX = (startTime - qmlProfilerModelProxy.traceStartTime()) *
flick.width / (endTime-startTime);
if (isFinite(newStartX) && Math.abs(newStartX - flick.contentX) >= 1)
flick.contentX = newStartX;
}
}
}