Repository navigation
Conversation
This branch has not been deployed
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
isPointInRoundRectanglenever applied the bottom-left corner cutout: the y-range check inhandleLeftBottomwas inverted (point[1] >= rectY + height && point[1] <= rectY + height - radius, always false for a positive radius), so points outside the bottom-left arc were still reported as inside the shape. The other three corners worked. This affects hit testing for rounded shapes (round-rectangle,round-comment, flowchartterminal). The fix swaps the range to matchhandleRightBottom. Affected package:@plait/core.Related Issue
Closes #1171
Validation
Evidence and compatibility notes:
@plait/core@0.94.1and on develope0d76b09: for{ x: 0, y: 0, width: 20, height: 10 }with radius 4,isPointInRoundRectangle([1, 9], …)returnedtruewhile the equivalent points at the other three corners returnedfalse.math.spec.tsfail on the pre-fix code (1 FAILED / 72 SUCCESS) and pass with the fix (73 SUCCESS).npm run buildandnpm run ci:testpass locally (Node v26.13.0, ChromeHeadlessCI);npm run lintwas run.Changeset
@plait/corepatch)AI Assistance
No
Yes
Tool/model: Qoder coding agent (model name not exposed by the tool)
AI-assisted work: the
math.tsfix, the new specs, and the changesetMy review and validation: verified the inverted range against the issue repro and the other three corner handlers, checked all callers for compensating workarounds, and ran the baseline-vs-fixed test comparison plus the full build and ci:test listed above.
I reviewed and understand the AI-assisted changes and can explain and maintain them
Checklist