From f28b1e9bf305798ea3e932ca69f4b5fa12263a9b Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Mon, 14 Aug 2023 04:58:20 +0000 Subject: [PATCH] Battle frame: Fix height on small screens This bug hasn't been noticed because the two main uses of battle frames (the sim itself, and Replays) both absolutely position battle frames, so they have nothing "below" them. But on downloaded replays, on screens smaller than 640px across, they took up an incorrect height. This is also relevant to New Replays. This commit fixes that. --- src/battle.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/battle.ts b/src/battle.ts index 7b1f62548..5217a3520 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -1176,10 +1176,12 @@ export class Battle { const scale = (width / 640); this.scene.$frame?.css('transform', 'scale(' + scale + ')'); this.scene.$frame?.css('transform-origin', 'top left'); + this.scene.$frame?.css('margin-bottom', '' + (360 * scale - 360) + 'px'); // this.$foeHint.css('transform', 'scale(' + scale + ')'); } else { this.scene.$frame?.css('transform', 'none'); // this.$foeHint.css('transform', 'none'); + this.scene.$frame?.css('margin-bottom', '0'); } };