fixe position issue

This commit is contained in:
Didictateur 2025-03-24 14:15:20 +01:00
parent 264168ea91
commit 2061b39c11
3 changed files with 9 additions and 3 deletions

View file

@ -6,3 +6,8 @@ all:
clean: clean:
rm -rf build/ rm -rf build/
hard-clean:
rm -rf build/
rm -rf node_modules/
rm -f package-lock.json

View file

@ -26,7 +26,7 @@ export function clickAction(
return -1; return -1;
} }
let xmin = 960 - buttons.filter(c => c[0]).length * 120; let xmin = 960 - buttons.filter(c => c[0]).length * 120;
let inside = 492 < y && y < 544; let inside = 838 < y && y < 888;
let q = Math.floor((x - xmin) / 120); let q = Math.floor((x - xmin) / 120);
let r = (x - xmin) - 120 * q; let r = (x - xmin) - 120 * q;
if ( if (

View file

@ -93,9 +93,10 @@ export class Game {
public click( public click(
mp: mousePos, mp: mousePos,
): void { ): void {
const rect = this.cv.getBoundingClientRect();
let action = clickAction( let action = clickAction(
mp.x, mp.x - rect.left,
mp.y, mp.y - rect.top,
this.canDoAChii().length > 0, this.canDoAChii().length > 0,
this.canDoAPon(), this.canDoAPon(),
false && this.level > 1, false && this.level > 1,