fix: include camera dimensions in overlay cache key for resize handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-08 04:15:12 +00:00
parent 736941d190
commit 4d6ca21bda
+3 -4
View File
@@ -705,7 +705,9 @@ export class GameScene extends Phaser.Scene {
private renderDayNightOverlay(): void {
const { phase, progress } = this.getDayNightPhase(this.currentGameTime);
const phaseKey = `${phase}-${Math.round(progress * 100)}`;
const w = this.cameras.main.width;
const h = this.cameras.main.height;
const phaseKey = `${phase}-${Math.round(progress * 100)}-${w}-${h}`;
// Skip redraw if nothing changed
if (phaseKey === this.lastPhaseKey) return;
@@ -714,9 +716,6 @@ export class GameScene extends Phaser.Scene {
this.dayNightOverlay.clear();
if (phase === 'day') return;
const w = this.cameras.main.width;
const h = this.cameras.main.height;
const stripCount = 50;
const stripWidth = Math.ceil(w / stripCount);