Fixing unit movements and phaseAnimation

This commit is contained in:
Tyler Marques 2025-03-07 13:06:14 -05:00
parent 9fb022c782
commit b5dcd78898
No known key found for this signature in database
GPG key ID: 7672EFD79378341C
2 changed files with 8 additions and 11 deletions

View file

@ -1,9 +1,14 @@
export const addMapMouseEvents = (mapView: HTMLElement, display: HTMLElement) => {
const isDebugMode = process.env.NODE_ENV === 'development' || localStorage.getItem('debug') === 'true';
mapView.addEventListener("mousemove", (event) => {
const rect = mapView.getBoundingClientRect();
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;
display.textContent = `X: ${x.toFixed(2)}, Y: ${y.toFixed(2)}\nrect ${JSON.stringify(rect)}`;
if (isDebugMode) {
display.textContent = `X: ${x.toFixed(2)}, Y: ${y.toFixed(2)}\nrect ${JSON.stringify(rect)}`;
}
})
}