mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-29 05:24:30 +08:00
feat: 弹幕性能优化
This commit is contained in:
1 parent
6202dbce62
commit
f2fecbb6c6
4 files changed
+65
-52
No files matched your search
@@ -109,7 +109,7 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
strokeColor: string = 'black';
|
||||
|
||||
private posted: boolean = false;
|
||||
private vNode?: VNode;
|
||||
vNode?: VNode;
|
||||
private posting: boolean = false;
|
||||
|
||||
/**
|
||||
@@ -351,6 +351,7 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
* 显示这个弹幕
|
||||
*/
|
||||
show() {
|
||||
if (this.showing) return;
|
||||
this.showing = true;
|
||||
Danmaku.showList.push(this);
|
||||
Danmaku.showMap.set(this.id, this);
|
||||
@@ -361,6 +362,7 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
* 显示结束这个弹幕
|
||||
*/
|
||||
showEnd() {
|
||||
if (!this.showing) return;
|
||||
this.showing = false;
|
||||
deleteWith(Danmaku.showList, this);
|
||||
Danmaku.showMap.delete(this.id);
|
||||
|
||||
Reference in new issue
Block a user