Skip to content

Commit 49da3a5

Browse files
committed
fix(timeline): reduce glitch when mouse dragging the canvas at the bottom
1 parent e459259 commit 49da3a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/app-frontend/src/features/timeline/TimelineView.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
watch,
1111
watchEffect,
1212
defineComponent,
13+
computed,
1314
} from '@vue/composition-api'
1415
import { SharedData, isMac } from '@vue-devtools/shared-utils'
1516
import {
@@ -372,6 +373,8 @@ export default defineComponent({
372373
resetLayers()
373374
})
374375
376+
const totalLayersHeight = computed(() => layers.value.reduce((sum, layer) => sum + layer.height, 0))
377+
375378
// Layer hover
376379
377380
let layerHoverEffect: PIXI.Graphics
@@ -1313,7 +1316,7 @@ export default defineComponent({
13131316
endTime.value = start + size
13141317
13151318
// Vertical
1316-
layersScroller.scrollTop = startDragScrollTop + deltaY
1319+
layersScroller.scrollTop = Math.min(totalLayersHeight.value, startDragScrollTop + deltaY)
13171320
}
13181321
}
13191322

0 commit comments

Comments
 (0)