Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Chat/lib/lira-avatar/liraCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export class LiraCore {
autoStart: true,
sharedTicker: true, // Back to shared, easier for singleton
backgroundAlpha: 0,
resizeTo: this.container, // Initial resize target
antialias: true,
autoDensity: true,
resolution: window.devicePixelRatio || 1
Expand All @@ -63,6 +62,14 @@ export class LiraCore {
globalCanvas = this.canvas;
this.app = globalApp;
globalApp.ticker.stop(); // Wait for model

// FIX: Force immediate renderer resize to fix "Disappearing Head" (Masking)
// Ensure we NEVER resize to 0x0. Use safe defaults if container is collapsing.
if (this.app.renderer) {
const safeW = Math.max(this.container.clientWidth, 250);
const safeH = Math.max(this.container.clientHeight, 250);
this.app.renderer.resize(safeW, safeH);
}
} else {
console.log("[LiraCore] Reusing Global Singleton Context (Resurrection)");
this.app = globalApp;
Expand Down Expand Up @@ -224,8 +231,8 @@ export class LiraCore {
if (!this.model || !this.app || !this.app.renderer) return;

// 1. Force App/Renderer Resize
const w = this.container.clientWidth;
const h = this.container.clientHeight;
const w = Math.max(this.container.clientWidth, 250);
const h = Math.max(this.container.clientHeight, 250);
this.app.renderer.resize(w, h);

const screenW = this.app.screen.width;
Expand Down