thelostword / timeline

Canvas timeline, supports zooming, dragging, and infinite scrolling. -- Canvas 时间轴组件,支持缩放、拖拽、无限滚动
https://thelostword.github.io/timeline/
MIT License
41 stars 7 forks source link

Fix #9 Drag Functionality for Firefox Compatibility #10

Closed muhammad-towfique-imam closed 1 month ago

muhammad-towfique-imam commented 1 month ago

Description

The current implementation of the drag functionality in the TimeLine class is not working properly on Firefox. Specifically, the offsetX property is inconsistent and sometimes returns 0, which breaks the dragging behavior.

Current Behavior

Expected Behavior

Proposed Solution

Replace the current drag implementation with a cross-browser compatible solution:

  1. Use clientX instead of offsetX for tracking mouse movement
  2. Update the moveListener and outsideListener to use the new mouse position calculation method