Skip to content

Commit

Permalink
Battle frame: Fix height on small screens
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Zarel authored and AnnikaCodes committed Oct 25, 2023
1 parent ae55432 commit bc7aa51
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};

Expand Down

0 comments on commit bc7aa51

Please sign in to comment.