Skip to content

Commit

Permalink
Timeline: Don't set the zoom slider to externally updated when it isn't
Browse files Browse the repository at this point in the history
In particular, the value seems to be an int and so we have to round the
new value before comparing it. If it then is the same as the old value,
valueChanged won't be called and the flag won't be cleared.

Change-Id: I64e26ca322afe1093c689d498c9110e524ff2964
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
ulherman committed Dec 7, 2015
1 parent e339fd5 commit be5b1ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/libs/timeline/qml/MainView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,13 @@ Rectangle {
anchors.top: buttonsBar.bottom

function updateZoomLevel() {
zoomSlider.externalUpdate = true;
zoomSlider.value = Math.pow(zoomControl.rangeDuration /
Math.max(1, zoomControl.windowDuration),
1 / zoomSlider.exponent) * zoomSlider.maximumValue;
var newValue = Math.round(Math.pow(zoomControl.rangeDuration /
Math.max(1, zoomControl.windowDuration),
1 / zoomSlider.exponent) * zoomSlider.maximumValue);
if (newValue !== zoomSlider.value) {
zoomSlider.externalUpdate = true;
zoomSlider.value = newValue;
}
}

Slider {
Expand Down

0 comments on commit be5b1ab

Please sign in to comment.