🐛 fix UI repositioning and mouse coords after window resize

This commit is contained in:
2026-03-20 12:19:57 +00:00
parent 5828f40497
commit 8ed67313a8
4 changed files with 41 additions and 12 deletions

View File

@@ -80,9 +80,8 @@ export class FarmingSystem {
// ─── Tool actions ─────────────────────────────────────────────────────────
private useToolAt(ptr: Phaser.Input.Pointer): void {
const cam = this.scene.cameras.main
const worldX = cam.scrollX + ptr.x
const worldY = cam.scrollY + ptr.y
const worldX = ptr.worldX
const worldY = ptr.worldY
const tileX = Math.floor(worldX / TILE_SIZE)
const tileY = Math.floor(worldY / TILE_SIZE)
const state = stateManager.getState()