fix: invert Y coordinate to match backend generation#959
Conversation
- Improved alignment for carpets and room names by correcting grid coordinate logic - Synced backend image generation with frontend visual standards (mop path opacity, alignment) - Refactored coordinate calculations to use shared constants and added regression tests for stability - Optimized mop path width for better visual clarity
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private worldToSvgCoords(x: number, y: number): Point { | ||
| if (this.mapMinX === undefined || this.mapMinY === undefined) return { x: 0, y: 0 }; | ||
| return { x: x - this.mapMinX, y: y - this.mapMinY }; | ||
| // Since we no longer translate the background image (it sits at 0,0), | ||
| // we should not subtract mapMinX from the coordinates. | ||
| // However, World Coordinates (from coords.ts) are 0-based relative to the Grid. | ||
| // And the Image starts at Grid 0. |
There was a problem hiding this comment.
Screen/world conversions now double-apply map padding
The new worldToSvgCoords no longer subtracts mapMinX/mapMinY, but screenToWorldCoords and the GoTo handler still add those padding values to pointer coordinates (e.g., when placing zones or GoTo targets). On maps with transparent borders where mapMin* > 0, clicks are converted to world/robot coordinates offset by that padding, so zones and GoTo commands will land away from the point the user clicked.
Useful? React with 👍 / 👎.
No description provided.