diff --git a/src/components/Context.vue b/src/components/Context.vue index 21ded12..d752460 100644 --- a/src/components/Context.vue +++ b/src/components/Context.vue @@ -12,6 +12,7 @@ import { } from "game/layers"; import type { FeatureNode } from "game/layers"; import { nextTick, onMounted, provide, ref } from "vue"; +import { globalBus } from "game/events"; const emit = defineEmits<{ (e: "updateNodes", nodes: Record): void; @@ -31,7 +32,7 @@ onMounted(() => { let isDirty = true; let boundingRect = ref(resizeListener.value?.getBoundingClientRect()); function updateBounds() { - if (resizeListener.value != null && isDirty) { + if (isDirty) { isDirty = false; nextTick(() => { boundingRect.value = resizeListener.value?.getBoundingClientRect(); @@ -43,7 +44,7 @@ function updateBounds() { }); } } -document.fonts.ready.then(updateBounds); +globalBus.on("fontsLoaded", updateBounds); const observerOptions = { attributes: false, diff --git a/src/features/particles/Particles.vue b/src/features/particles/Particles.vue index 8a3dd2d..1f7de78 100644 --- a/src/features/particles/Particles.vue +++ b/src/features/particles/Particles.vue @@ -10,6 +10,7 @@