CesiumGS / CesiumGS/cesium

Bug when zooming timeline too fast

Open
#4,425 12 comments 0 reactions 0 assignees View on GitHub
category - widgets type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

Steps to reproduce:
1. Load https://cesiumjs.org/Cesium/Apps/HelloWorld.html
2. Put cursor over timeline and give it one fast scroll (two fingers on touchpad)
3. Try zooming a few more times and it should not zoom anymore

I think the bug is in the code below. It goes away if you make `timelineWheelDelta` constnat, but this decouples zooming speed from scrolling speed.

```
function createMouseWheelCallback(timeline) {
return function(e) {
var dy = e.wheelDeltaY || e.wheelDelta || (-e.detail);
timelineWheelDelta = Math.max(Math.min(Math.abs(dy), timelineWheelDelta), 1);
dy /= timelineWheelDelta;
timeline.zoomFrom(Math.pow(1.05, -dy));
};
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the linked Cesium HelloWorld application by scrolling rapidly over the timeline. Then locate createMouseWheelCallback and inspect how timelineWheelDelta changes between wheel events. Done means repeated fast zooming continues to work while scrolling speed still affects zoom speed; the payload names no test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.