mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 11:11:20 -08:00
Revert "feat: enhance Danmuku plugin with batch processing for top calculations"
This reverts commit 1841f754dc.
This commit is contained in:
1 parent
e112b33f97
commit
3ae89ab349
4 files changed
+65
-251
No files matched your search
@@ -135,29 +135,12 @@ function getDanmuTop({ target, visibles, clientWidth, clientHeight, marginBottom
|
||||
}
|
||||
}
|
||||
|
||||
function getDanmuTopBatch({ targets, visibles, clientWidth, clientHeight, marginBottom, marginTop, antiOverlap }) {
|
||||
if (!Array.isArray(targets) || targets.length === 0)
|
||||
return []
|
||||
|
||||
return targets.map((target) => {
|
||||
return getDanmuTop({
|
||||
target,
|
||||
visibles,
|
||||
clientWidth,
|
||||
clientHeight,
|
||||
marginBottom,
|
||||
marginTop,
|
||||
antiOverlap,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onmessage = (event) => {
|
||||
const { data } = event
|
||||
if (!data.id || !data.type)
|
||||
return
|
||||
|
||||
const fns = { getDanmuTop, getDanmuTopBatch }
|
||||
const fns = { getDanmuTop }
|
||||
const fn = fns[data.type]
|
||||
const result = fn(data)
|
||||
|
||||
|
||||
Reference in new issue
Block a user