fixe position issue
This commit is contained in:
parent
264168ea91
commit
2061b39c11
3 changed files with 9 additions and 3 deletions
5
Makefile
5
Makefile
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue