Commit 18ca8139 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Guard the overview against recursively changing the range



This is insignificant at lower zoom levels but becomes really annoying
when closer to the 500ns limit.

Task-number: QTCREATORBUG-11879
Change-Id: Ide0069f7c6b135aa31262a4396559fa3ba89f8e3
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent ca78bb35
......@@ -41,6 +41,7 @@ Canvas {
property bool dataReady: false
property double startTime : 0
property double endTime : 0
property bool recursionGuard: false
// ***** functions
function clear()
......@@ -50,6 +51,8 @@ Canvas {
}
function updateRange() {
if (recursionGuard)
return;
var newStartTime = Math.round(rangeMover.getLeft() * qmlProfilerModelProxy.traceDuration() / width) + qmlProfilerModelProxy.traceStartTime();
var newEndTime = Math.round(rangeMover.getRight() * qmlProfilerModelProxy.traceDuration() / width) + qmlProfilerModelProxy.traceStartTime();
if ((startTime !== newStartTime || endTime !== newEndTime) && newEndTime - newStartTime > 500) {
......@@ -66,6 +69,7 @@ Canvas {
target: zoomControl
onRangeChanged: {
if (qmlProfilerModelProxy) {
recursionGuard = true;
startTime = clamp(zoomControl.startTime(), qmlProfilerModelProxy.traceStartTime(), qmlProfilerModelProxy.traceEndTime());
endTime = clamp(zoomControl.endTime(), startTime, qmlProfilerModelProxy.traceEndTime());
var newRangeX = (startTime - qmlProfilerModelProxy.traceStartTime()) * width / qmlProfilerModelProxy.traceDuration();
......@@ -77,6 +81,7 @@ Canvas {
if (leftChanged || widthChanged)
rangeMover.setRight(newRangeX + newWidth);
recursionGuard = false;
}
}
}
......
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