diff --git a/frontend/src/canvas/sprites/AnimatedGifSprite.ts b/frontend/src/canvas/sprites/AnimatedGifSprite.ts index 64f9380..1cb4785 100644 --- a/frontend/src/canvas/sprites/AnimatedGifSprite.ts +++ b/frontend/src/canvas/sprites/AnimatedGifSprite.ts @@ -1,4 +1,4 @@ -import { Container, Graphics } from "pixi.js"; +import { Container, Graphics, Texture } from "pixi.js"; import { GifSprite } from "pixi.js/gif"; import { TextureManager } from "../TextureManager"; @@ -70,7 +70,7 @@ export class AnimatedGifSprite extends Container { /** The underlying GIF sprite's current texture (for clipboard/export). */ get texture() { - return this._gif?.texture ?? null; + return this._gif?.texture ?? Texture.EMPTY; } /** Whether the GIF is currently animating. */ @@ -134,6 +134,7 @@ export class AnimatedGifSprite extends Container { if (this._gif) { this._gif.stop(); this._playing = false; + this._gif.texture = Texture.EMPTY; } this.textures.releaseGif(this.assetKey); this.loaded = false; @@ -148,6 +149,9 @@ export class AnimatedGifSprite extends Container { if (this._gif) { this._gif.stop(); this._playing = false; + // Swap to EMPTY before destroying so PixiJS never reads a null source + // during its render-loop traversal (collectRenderables → alphaMode). + this._gif.texture = Texture.EMPTY; this.removeChild(this._gif); this._gif.destroy(); this._gif = null; diff --git a/frontend/src/canvas/sprites/PdfPageSprite.ts b/frontend/src/canvas/sprites/PdfPageSprite.ts index daddbd6..ff2cb84 100644 --- a/frontend/src/canvas/sprites/PdfPageSprite.ts +++ b/frontend/src/canvas/sprites/PdfPageSprite.ts @@ -241,6 +241,9 @@ export class PdfPageSprite extends Container { // Remove sprite from display tree entirely — avoids PixiJS v8 render crash if (this._sprite) { + // Swap to EMPTY before destroying so PixiJS never reads a null source + // during its render-loop traversal (collectRenderables → alphaMode). + this._sprite.texture = Texture.EMPTY; this.removeChild(this._sprite); this._sprite.destroy(); this._sprite = null; diff --git a/frontend/src/pages/Editor.tsx b/frontend/src/pages/Editor.tsx index 2bcad5c..dda0f75 100644 --- a/frontend/src/pages/Editor.tsx +++ b/frontend/src/pages/Editor.tsx @@ -1150,21 +1150,29 @@ export default function Editor({ isPublicView }: EditorProps) { canvasTransform={canvasTransform} /> - {/* Loading / Empty canvas guide */} + {/* Loading overlay — blocks interaction until scene is ready */} {(sceneLoading || (objectCount > 0 && loadProgress.total > 0 && loadProgress.loaded < loadProgress.total)) && (
-
+
+ +
{sceneLoading - ? `Loading ${loadProgress.total || '...'} items` - : `Loading assets ${loadProgress.loaded}/${loadProgress.total}`} + ? `Loading ${loadProgress.total || ''} items…` + : `Loading assets ${loadProgress.loaded} / ${loadProgress.total}`}
{loadProgress.total > 0 && (