From 7fdc415f09a3cd41c94359499bc2e33e4857baf8 Mon Sep 17 00:00:00 2001 From: ienaga Date: Mon, 2 Jun 2025 08:09:57 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=81=AE?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=87=A6=E7=90=86=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- template/package.json | 20 +++++++++---------- .../src/model/domain/callback/Background.ts | 19 +++++++++--------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 3293dd9..72a5e1f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@next2d/framework-typescript-template", "description": "Next2D Framework default TypeScript template.", - "version": "3.2.1", + "version": "3.2.2", "homepage": "https://next2d.app", "bugs": "https://github.com/Next2D/framework-typescript-template/issues/new", "author": "Toshiyuki Ienaga", diff --git a/template/package.json b/template/package.json index ede5dc9..cde3dca 100644 --- a/template/package.json +++ b/template/package.json @@ -24,19 +24,19 @@ "@capacitor/core": "^7.2.0", "@capacitor/ios": "^7.2.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.25.1", - "@next2d/vite-plugin-next2d-auto-loader": "^3.1.2", - "@types/node": "^22.15.3", - "@typescript-eslint/eslint-plugin": "^8.31.1", - "@typescript-eslint/parser": "^8.31.1", - "@vitest/web-worker": "^3.1.2", - "eslint": "^9.25.1", + "@eslint/js": "^9.28.0", + "@next2d/vite-plugin-next2d-auto-loader": "^3.1.4", + "@types/node": "^22.15.29", + "@typescript-eslint/eslint-plugin": "^8.33.0", + "@typescript-eslint/parser": "^8.33.0", + "@vitest/web-worker": "^3.1.4", + "eslint": "^9.28.0", "eslint-plugin-unused-imports": "^4.1.4", - "globals": "^16.0.0", + "globals": "^16.2.0", "jsdom": "^26.1.0", "typescript": "^5.8.3", - "vite": "^6.3.4", - "vitest": "^3.1.2", + "vite": "^6.3.5", + "vitest": "^3.1.4", "vitest-webgl-canvas-mock": "^1.1.0" }, "peerDependencies": { diff --git a/template/src/model/domain/callback/Background.ts b/template/src/model/domain/callback/Background.ts index 8d3b846..38e1dda 100644 --- a/template/src/model/domain/callback/Background.ts +++ b/template/src/model/domain/callback/Background.ts @@ -26,6 +26,11 @@ export class Background constructor () { this.shape = new Shape(); + stage.addEventListener(Event.RESIZE, (): void => + { + backgroundDrawService(this); + backgroundChangeScaleService(this); + }); } /** @@ -45,17 +50,11 @@ export class Background } const shape = this.shape; - if (stage && !stage.hasEventListener(Event.RESIZE)) { - stage.addEventListener(Event.RESIZE, () => - { - backgroundChangeScaleService(this); - backgroundDrawService(this); - }); - } - - if (config.stage.width !== shape.width) { - backgroundChangeScaleService(this); + if (config.stage.width !== shape.width + || config.stage.height !== shape.height + ) { backgroundDrawService(this); + backgroundChangeScaleService(this); } /**