Skip to content

Conversation

seveibar
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
calculate-packing Ready Ready Preview Comment Sep 14, 2025 4:41pm

Copy link

@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 suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

Comment on lines +172 to +184
let viableBounds = {
minX: largestRectBounds.minX - componentBounds.minX * segmentNormAbs.x,
minY: largestRectBounds.minY - componentBounds.minY * segmentNormAbs.y,
maxX: largestRectBounds.maxX - componentBounds.maxX * segmentNormAbs.x,
maxY: largestRectBounds.maxY - componentBounds.maxY * segmentNormAbs.y,
}

if (this.globalBounds) {
viableBounds = {
minX: Math.max(viableBounds.minX, this.globalBounds.minX),
minY: Math.max(viableBounds.minY, this.globalBounds.minY),
maxX: Math.min(viableBounds.maxX, this.globalBounds.maxX),
maxY: Math.min(viableBounds.maxY, this.globalBounds.maxY),

Choose a reason for hiding this comment

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

[P1] Intersecting with global bounds ignores component size

When global bounds are provided, viableBounds is intersected with those limits directly but without shrinking them by the component’s extents. For axes where segmentNormAbs is 0 (e.g., a vertical outline segment), the viable center range still spans the full largestRectBounds on that axis, so the resulting candidate can have its center at globalBounds.maxX or minX while the component’s body extends past the edge. If the user specifies tight board bounds, the solver will now generate placements that protrude outside the bounds even though it claims to respect them. Intersecting should subtract the component’s min/max offsets from this.globalBounds before clamping.

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