Commit 13abd6d6 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Restrict selection ranges to a minimum of 500ns

Smaller ranges shouldn't be useful for anything but create rounding
errors all over the place.

Task-number: QTCREATORBUG-10880
Change-Id: I5cf5e2c08b5cae676717ba8ada1cddee4523c399
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 5a268789
......@@ -51,7 +51,7 @@ Canvas2D {
function updateRange() {
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) {
if ((startTime !== newStartTime || endTime !== newEndTime) && newEndTime - newStartTime > 500) {
zoomControl.setRange(newStartTime, newEndTime);
}
}
......
......@@ -39,7 +39,7 @@ RangeMover {
property string durationString: detailedPrintTime(duration)
property real startTime: getLeft() * viewTimePerPixel + qmlProfilerModelProxy.traceStartTime()
property real duration: getWidth() * viewTimePerPixel
property real duration: Math.max(getWidth() * viewTimePerPixel, 500)
property real viewTimePerPixel: 1
property int creationState : 0
......
Markdown is supported
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