Commit 75aa69e3 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: domino endpoint tap on empty board + status update on select

- Empty board now returns hit on any board tap when active endpoint set
- Status text updates immediately when tile is selected/deselected
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 0bc5a2fb
......@@ -121,6 +121,11 @@ export class DominoBoard {
const rightEp = this.layout.endpoints.right;
const radius = getSnapRadius() / this.zoom;
// Empty board: tap anywhere = center placement
if (!leftEp && !rightEp && this.activeEndpoint) {
return { end: 'right', value: null };
}
if (leftEp && dist(worldX, worldY, leftEp.x, leftEp.y) < radius) return { end: 'left', value: leftEp.value };
if (rightEp && dist(worldX, worldY, rightEp.x, rightEp.y) < radius) return { end: 'right', value: rightEp.value };
return null;
......
......@@ -508,6 +508,7 @@ function handleTileSelect(el, tile) {
state.selectedTile = null;
hand.clearSelection();
board.clearActiveEndpoint();
updateUI(el);
return;
}
......@@ -518,11 +519,11 @@ function handleTileSelect(el, tile) {
// First tile on empty board → show center endpoint
if (state.chain.length === 0) {
board.setActiveEndpoint('both');
return;
} else {
board.setActiveEndpoint(playEnd);
}
// Show which endpoints this tile can play on
board.setActiveEndpoint(playEnd);
updateUI(el);
}
function handleEndpointTap(el, hit) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment