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); } /**