fix(spotdiff): Klick-Position stimmt jetzt auf Retina-Displays (kein doppelter DPR-Skalier)

This commit is contained in:
Stefan Franke 2026-07-22 11:04:18 +02:00
parent b759e04a01
commit b871449cc7

View file

@ -335,7 +335,7 @@ window.MG_spotdiff = (function() {
canvasB.addEventListener('click', e => {
if (found.size >= scene.spots.length) return;
const rect = canvasB.getBoundingClientRect();
const mx = (e.clientX - rect.left) * (canvasB.width / rect.width / (window.devicePixelRatio || 1));
const mx = (e.clientX - rect.left) * (canvasB.width / rect.width);
const my = (e.clientY - rect.top) * (canvasB.height / rect.height);
// Reihenfolge = Priorität: erste passende Spot gewinnt (radial-Spots vor rect-Catchall)