Use canvas instead of div container for calculating the game size

This commit is contained in:
Paul Bottein 2021-01-27 12:38:57 +01:00
parent b7b2934106
commit b52c546a8c
2 changed files with 10 additions and 1 deletions

View file

@ -212,7 +212,7 @@ class LayoutManager {
* Tries to find the biggest available box of remaining space (this is a space where we can center the character)
*/
public findBiggestAvailableArray(): {xStart: number, yStart: number, xEnd: number, yEnd: number} {
const game = HtmlUtils.getElementByIdOrFail<HTMLDivElement>('game');
const game = HtmlUtils.querySelectorOrFail<HTMLDivElement>('#game canvas');
if (this.mode === LayoutMode.VideoChat) {
const children = document.querySelectorAll<HTMLDivElement>('div.chat-mode > div');
const htmlChildren = Array.from(children.values());