aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-02-27 12:48:32 +0100
committerUlf Hermann <ulf.hermann@digia.com>2014-02-27 14:54:56 +0100
commitbd43c1c51b0fb16b5be3b036baade03cdf564d58 (patch)
treecd53319f3becdca2c793a7d2d18e8c85f45c5fcc /src/plugins/qmlprofiler
parent3cc743f1bf54da047cefc575dac03aa71a0dc88b (diff)
QmlProfiler: take the left border into account when painting time marks
Without this the time marks are 1 pixel off in relation to the main view. Change-Id: Iee8aaee447fedb9c57934c8089874414d9000995 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/qml/TimeDisplay.qml9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/qmlprofiler/qml/TimeDisplay.qml b/src/plugins/qmlprofiler/qml/TimeDisplay.qml
index 12cecf435f1..4327d427312 100644
--- a/src/plugins/qmlprofiler/qml/TimeDisplay.qml
+++ b/src/plugins/qmlprofiler/qml/TimeDisplay.qml
@@ -54,17 +54,18 @@ Canvas {
context.fillStyle = "white";
context.fillRect(0, 0, width, height);
+ var realWidth = width - 1; // account for left border
var totalTime = endTime - startTime;
- var spacing = width / totalTime;
+ var spacing = realWidth / totalTime;
var initialBlockLength = 120;
- var timePerBlock = Math.pow(2, Math.floor( Math.log( totalTime / width * initialBlockLength ) / Math.LN2 ) );
+ var timePerBlock = Math.pow(2, Math.floor( Math.log( totalTime / realWidth * initialBlockLength ) / Math.LN2 ) );
var pixelsPerBlock = timePerBlock * spacing;
var pixelsPerSection = pixelsPerBlock / 5;
- var blockCount = width / pixelsPerBlock;
+ var blockCount = realWidth / pixelsPerBlock;
var realStartTime = Math.floor(startTime/timePerBlock) * timePerBlock;
- var realStartPos = (startTime-realStartTime) * spacing;
+ var realStartPos = (startTime - realStartTime) * spacing - 1;
timePerPixel = timePerBlock/pixelsPerBlock;