Repository navigation
fix: pointer events firing on two elements at a shared edge - #161
Conversation
Changeset suggestionThe current changeset no longer matches this PR. This review contains a corrected replacement. Why: Changeset package scope does not match the affected packages confidently. View the proposed changeset---
'@bomb.sh/tty': patch
---
TODO: Write changeset message (inference failed: HTTP 401: {"error":{"message":"User not found.","code":401}})Review this changeset manually If this draft is correct, react with 🚀 and Cooper will commit it to this branch. |
| @@ -0,0 +1,5 @@ | |||
| --- | |||
There was a problem hiding this comment.
Changeset needs revision.
Changeset package scope does not match the affected packages confidently.
View the proposed replacement
---
'@bomb.sh/tty': patch
---
TODO: Write changeset message (inference failed: HTTP 401: {"error":{"message":"User not found.","code":401}})|
Size Reduced — -0.0 KB 129.4 KB unpacked |
commit: |
There was a problem hiding this comment.
Awesome!
This seems like a sound fix to me (doing hit testing in the middle of the cell) This might have consequences for sub-pixel rendering, but that would be more in @natemoo-re's wheel house.
natemoo-re
left a comment
There was a problem hiding this comment.
Awesome, thanks @dreyfus92! Ignore cooper, it's way too aggressive right now 🫣
Agree with @cowboyd that there might be consequences for subcell precision, but we'll cross that bridge when we get there!
What does this PR do?
clay's point-in-rect test includes both edges, and
reducewas passing the integer cell corner toClay_SetPointerState, so the first cell of an element also landed inside the element before it. now it hit-tests the cell center (x + 0.5, y + 0.5). this also fixes the pointer shape leaking across the edge (the cell right after acursor: "text"field showedtext) and a pointer past the last column still hitting the last elementadded a sentence to renderer-spec §12.4 defining hit testing by cell
closes: #150
Type of change
Checklist
pnpm test)pnpm format)AI-generated code disclosure