From bc574db0341ca673b696aec7c5864ab38dcbe8f1 Mon Sep 17 00:00:00 2001 From: MinHo Lim Date: Tue, 28 Oct 2025 11:06:44 +0900 Subject: [PATCH] fix: add viewport setter --- src/patchmap.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/patchmap.js b/src/patchmap.js index 5f2c4b1a..4f55904e 100644 --- a/src/patchmap.js +++ b/src/patchmap.js @@ -43,6 +43,10 @@ class Patchmap extends WildcardEventEmitter { return this._viewport; } + set viewport(value) { + this._viewport = value; + } + get theme() { return this._theme.get(); } @@ -123,7 +127,7 @@ class Patchmap extends WildcardEventEmitter { this._theme.set(themeOptions); this._app = new Application(); await initApp(this.app, { resizeTo: element, ...appOptions }); - this._viewport = initViewport(this.app, viewportOptions); + this.viewport = initViewport(this.app, viewportOptions); await initAsset(assetsOptions); initCanvas(element, this.app); @@ -150,7 +154,7 @@ class Patchmap extends WildcardEventEmitter { if (this._resizeObserver) this._resizeObserver.disconnect(); this._app = null; - this._viewport = null; + this.viewport = null; this._resizeObserver = null; this.isInit = false; this._theme = themeStore();