Fix rule extent square coordinates to be relative to extent origin#109
Merged
Fix rule extent square coordinates to be relative to extent origin#109
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sx,sy) by subtracting the extent's minimum coordinates from the absolute coordinatessquares.push()calls to use the relative coordinates (sx,sy) instead of absolute coordinates (x,y)Implementation Details
The change introduces a simple coordinate transformation at the beginning of the square evaluation loop:
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