From 588978d9ef99495bee68a95acb738a0c2216f4db Mon Sep 17 00:00:00 2001 From: Rin Date: Wed, 17 Dec 2025 10:47:35 +0800 Subject: [PATCH] fix(stage-ui): AIRI in full resolution! fixed pixi.js resolution issue (#808) airi in full resolution let's goooo --- .../src/components/scenes/live2d/Canvas.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/stage-ui/src/components/scenes/live2d/Canvas.vue b/packages/stage-ui/src/components/scenes/live2d/Canvas.vue index b7b66cabc..f7947a03f 100644 --- a/packages/stage-ui/src/components/scenes/live2d/Canvas.vue +++ b/packages/stage-ui/src/components/scenes/live2d/Canvas.vue @@ -35,8 +35,12 @@ async function initLive2DPixiStage(parent: HTMLDivElement) { height: props.height * props.resolution, backgroundAlpha: 0, preserveDrawingBuffer: true, + autoDensity: false, + resolution: 1, }) + pixiApp.value.stage.scale.set(props.resolution) + pixiAppCanvas.value = pixiApp.value.view // Set CSS styles to make canvas responsive to container @@ -54,19 +58,15 @@ async function initLive2DPixiStage(parent: HTMLDivElement) { function handleResize() { if (pixiApp.value) { // Update the internal rendering resolution - pixiApp.value.renderer.resize(props.width, props.height) + pixiApp.value.renderer.resize(props.width * props.resolution, props.height * props.resolution) + pixiApp.value.stage.scale.set(props.resolution) } // The CSS styles handle the display size, so we don't need to manually set view dimensions } watch([() => props.width, () => props.height], () => handleResize()) -watch(() => props.resolution, (newScale) => { - if (pixiApp.value && newScale) { - pixiApp.value.renderer.resolution = newScale - handleResize() // Refresh the renderer - } -}) +watch(() => props.resolution, () => handleResize()) onMounted(async () => containerRef.value && await initLive2DPixiStage(containerRef.value)) onUnmounted(() => pixiApp.value?.destroy())