Constrain vertical scroll in layers panel
This commit is contained in:
parent
68a3c4d1ea
commit
6978c619d5
12
src/main.js
12
src/main.js
|
|
@ -3628,10 +3628,16 @@ function timeline() {
|
|||
const deltaX = event.deltaX * scrollSpeed;
|
||||
const deltaY = event.deltaY * scrollSpeed;
|
||||
|
||||
timeline_cvs.offsetX = Math.max(0, timeline_cvs.offsetX + deltaX);
|
||||
timeline_cvs.offsetY = Math.max(0, timeline_cvs.offsetY + deltaY);
|
||||
let maxScroll = context.activeObject.layers.length * layerHeight + gutterHeight - timeline_cvs.height
|
||||
|
||||
updateLayers()
|
||||
timeline_cvs.offsetX = Math.max(0, timeline_cvs.offsetX + deltaX);
|
||||
timeline_cvs.offsetY = Math.max(0, Math.min(maxScroll, timeline_cvs.offsetY + deltaY));
|
||||
|
||||
const currentTime = Date.now();
|
||||
if (currentTime - lastResizeTime > throttleIntervalMs) {
|
||||
lastResizeTime = currentTime;
|
||||
updateLayers();
|
||||
}
|
||||
});
|
||||
timeline_cvs.addEventListener("mousedown", (e) => {
|
||||
let mouse = getMousePos(timeline_cvs, e)
|
||||
|
|
|
|||
Loading…
Reference in New Issue