mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
fix: 缩放后画面消失
This commit is contained in:
parent
1203b5618d
commit
b018a5fd9a
@ -345,7 +345,6 @@ export const TextContent = defineComponent<TextContentProps, TextContentEmits>(
|
||||
* 从头开始渲染
|
||||
*/
|
||||
const rawRender = (text: string, lines: number[]) => {
|
||||
console.trace();
|
||||
makeRenderable(text, lines, 0, 0);
|
||||
spriteElement.value?.update();
|
||||
};
|
||||
|
@ -84,11 +84,27 @@ export class MotaRenderer extends Container {
|
||||
this.target.delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新所有元素
|
||||
*/
|
||||
refreshAll() {
|
||||
const stack: RenderItem[] = [this];
|
||||
while (stack.length > 0) {
|
||||
const item = stack.pop();
|
||||
if (!item) break;
|
||||
if (item.children.size === 0) {
|
||||
item.update();
|
||||
} else {
|
||||
item.children.forEach(v => stack.push(v));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get(id: string) {
|
||||
return this.list.get(id);
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
MotaRenderer.list.forEach(v => v.update(v));
|
||||
MotaRenderer.list.forEach(v => v.requestAfterFrame(() => v.refreshAll()));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user