3 ms·
I have hit this problem in a project of mine[0]. Users can zoom the timeline in and out, and what this does is adjust the width and the scrollLeft of the zoomed
by koch 4y ago
I have hit this problem in a project of mine[0]. Users can zoom the timeline in and out, and what this does is adjust the width and the scrollLeft of the zoomed element [1]. And zooming is exponential, so you very quickly get very large values.
Obviously I have feature requests for supporting both larger and smaller time scales so I'll have to figure something else to do. My initial inclination is to virtualize the scrolling, so the element has a minimum and maximum width, and when the user zooms in and out (beyond/close to the min/max) I reset the view and the scroll position. You definitely have to hide the scroll bar in this scenario as it would be jumping all over the place.
[0]: https://github.com/mark-when/markwhen/blob/9823e44d0445d3bf1954560e278c83dd4b4706e2/src/Views/Timeline/timelineStore.ts#L154 https://github.com/mark-when/markwhen/blob/9823e44d0445d3bf1...
[1]: https://github.com/mark-when/markwhen/blob/main/src/Views/Timeline/composables/useGestures.ts#L88 https://github.com/mark-when/markwhen/blob/main/src/Views/Ti...