Skip to content

fix: invert Y coordinate to match backend generation#959

Merged
copystring merged 3 commits into
mainfrom
fix/map-alignment
Dec 13, 2025
Merged

fix: invert Y coordinate to match backend generation#959
copystring merged 3 commits into
mainfrom
fix/map-alignment

Conversation

@copystring
Copy link
Copy Markdown
Owner

No description provided.

- 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
@copystring copystring merged commit 91df8b9 into main Dec 13, 2025
7 checks passed
@copystring copystring deleted the fix/map-alignment branch December 13, 2025 02:45
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/www/map.ts
Comment on lines 1065 to +1069
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

1 participant