修复潜在歌词滚动问题
parent
b867167b78
commit
78cf146a92
|
@ -14,6 +14,7 @@ import { scrollTo } from '@renderer/utils'
|
||||||
import Lyric from '@renderer/utils/lyric-font-player'
|
import Lyric from '@renderer/utils/lyric-font-player'
|
||||||
|
|
||||||
let cancelScrollFn = null
|
let cancelScrollFn = null
|
||||||
|
let delayScrollTimeout
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
@ -126,7 +127,8 @@ export default {
|
||||||
if (n < 0) return
|
if (n < 0) return
|
||||||
if (n == 0 && this.isSetedLines) return this.isSetedLines = false
|
if (n == 0 && this.isSetedLines) return this.isSetedLines = false
|
||||||
if (o == null || n - o != 1) return this.handleScrollLrc()
|
if (o == null || n - o != 1) return this.handleScrollLrc()
|
||||||
setTimeout(() => {
|
delayScrollTimeout = setTimeout(() => {
|
||||||
|
delayScrollTimeout = null
|
||||||
this.handleScrollLrc(600)
|
this.handleScrollLrc(600)
|
||||||
}, 600)
|
}, 600)
|
||||||
},
|
},
|
||||||
|
@ -251,6 +253,10 @@ export default {
|
||||||
this.lyricEvent.msDownY = y
|
this.lyricEvent.msDownY = y
|
||||||
this.lyricEvent.msDownScrollY = this.$refs.dom_lyric.scrollTop
|
this.lyricEvent.msDownScrollY = this.$refs.dom_lyric.scrollTop
|
||||||
} else {
|
} else {
|
||||||
|
if (delayScrollTimeout) {
|
||||||
|
clearTimeout(delayScrollTimeout)
|
||||||
|
delayScrollTimeout = null
|
||||||
|
}
|
||||||
this.winEvent.isMsDown = true
|
this.winEvent.isMsDown = true
|
||||||
this.winEvent.msDownX = x
|
this.winEvent.msDownX = x
|
||||||
this.winEvent.msDownY = y
|
this.winEvent.msDownY = y
|
||||||
|
|
|
@ -40,6 +40,10 @@ export default ({ isPlay, lyric }) => {
|
||||||
}
|
}
|
||||||
const handleLyricMouseDown = event => {
|
const handleLyricMouseDown = event => {
|
||||||
// console.log(event)
|
// console.log(event)
|
||||||
|
if (delayScrollTimeout) {
|
||||||
|
clearTimeout(delayScrollTimeout)
|
||||||
|
delayScrollTimeout = null
|
||||||
|
}
|
||||||
isMsDown.value = true
|
isMsDown.value = true
|
||||||
msDownY = event.clientY
|
msDownY = event.clientY
|
||||||
msDownScrollY = dom_lyric.value.scrollTop
|
msDownScrollY = dom_lyric.value.scrollTop
|
||||||
|
@ -103,12 +107,14 @@ export default ({ isPlay, lyric }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let delayScrollTimeout
|
||||||
const scrollLine = (line, oldLine) => {
|
const scrollLine = (line, oldLine) => {
|
||||||
if (line < 0) return
|
if (line < 0) return
|
||||||
if (line == 0 && isSetedLines) return isSetedLines = false
|
if (line == 0 && isSetedLines) return isSetedLines = false
|
||||||
if (oldLine == null || line - oldLine != 1) return handleScrollLrc()
|
if (oldLine == null || line - oldLine != 1) return handleScrollLrc()
|
||||||
|
|
||||||
setTimeout(() => {
|
delayScrollTimeout = setTimeout(() => {
|
||||||
|
delayScrollTimeout = null
|
||||||
handleScrollLrc(600)
|
handleScrollLrc(600)
|
||||||
}, 600)
|
}, 600)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue