Skip to content

Fix rule extent square coordinates to be relative to extent origin#109

Merged
bengotow merged 1 commit intomasterfrom
claude/fix-overlay-alignment-s2EBF
Mar 20, 2026
Merged

Fix rule extent square coordinates to be relative to extent origin#109
bengotow merged 1 commit intomasterfrom
claude/fix-overlay-alignment-s2EBF

Conversation

@bengotow
Copy link
Copy Markdown
Collaborator

Summary

Fixed the coordinate system for rule extent squares to be relative to the extent origin rather than absolute world coordinates. This ensures the overlay renderer can correctly position squares using the formula extentXMin + sq.x/y.

Key Changes

  • Calculate relative square coordinates (sx, sy) by subtracting the extent's minimum coordinates from the absolute coordinates
  • Updated all squares.push() calls to use the relative coordinates (sx, sy) instead of absolute coordinates (x, y)
  • Applied the fix across all square result types: offscreen, actor-count-mismatch, passed, and actor-match-failed

Implementation Details

The change introduces a simple coordinate transformation at the beginning of the square evaluation loop:

const sx = x - rule.extent.xmin;
const sy = y - rule.extent.ymin;

This makes the square coordinates 0-based relative to the extent origin, which aligns with how the overlay renderer expects to position them. All subsequent square result objects now use these relative coordinates instead of the loop's absolute coordinates.

https://claude.ai/code/session_01KyxX8Eu9UhWaMZZQQ4pdnt

… at 0,0

The overlay renderer (RecordingSquareStatus) positions squares using
extentXMin + square.x, expecting 0-based coordinates. But world-operator
was emitting squares with absolute rule extent coordinates (e.g. -1, 0, 1),
causing the overlay to be offset by extentXMin when it's non-zero.

Normalize square coordinates to be 0-based relative to the extent origin.

https://claude.ai/code/session_01KyxX8Eu9UhWaMZZQQ4pdnt
@bengotow bengotow merged commit 36afde7 into master Mar 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants