Commit 7b6efde1 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Use correct width for scaling timeline ranges

The width of the flickable element may be different from the width of
the timeline renderer because the flickable can have a scrollbar. This
is the same principle as in b3348dae .

Change-Id: Ife0064c4226ecff0e99d3d6aaf7a104b3c46e751
Task-number: QTCREATORBUG-12822
Reviewed-by: default avatarAlex Blasche <alexander.blasche@digia.com>
parent 646dcf0e
......@@ -48,7 +48,7 @@ RangeMover {
target: zoomControl
onRangeChanged: {
var oldTimePerPixel = selectionRange.viewTimePerPixel;
selectionRange.viewTimePerPixel = Math.abs(zoomControl.endTime() - zoomControl.startTime()) / flick.width;
selectionRange.viewTimePerPixel = Math.abs(zoomControl.endTime() - zoomControl.startTime()) / view.intWidth;
if (creationState === 3 && oldTimePerPixel != selectionRange.viewTimePerPixel) {
var newWidth = getWidth() * oldTimePerPixel / viewTimePerPixel;
setLeft(getLeft() * oldTimePerPixel / viewTimePerPixel);
......
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