Repository navigation
fix(scene): report declared indices in hit paths after clustering - #17
Merged
riteshshukla04 merged 1 commit intoNov 4, 2026
Merged
Conversation
|
@SectionTN is attempting to deploy a commit to the Margelo Team on Vercel. A member of the Team first needs to authorize it. |
SectionTN
marked this pull request as ready for review
November 3, 2026 08:19
Member
|
Can you rebase your PR with main |
Contributor
Author
|
hey, sure. i'm on it |
Batch clustering reorders a node's batchable children when the program is read, but hitWalk and collectHitPlanes reported each hit by its position in the reordered list. JS resolves hit paths by declared child index, so an unnamed rect, circle, oval or image in a list of eight or more siblings came back with another sibling's index. Nodes with a handle were never affected: a handle slots their geometry, which keeps them out of clustering. Each DrawCmd now carries the index it was declared at, and the hit walks report that.
SectionTN
force-pushed
the
fix/hit-test-paths-after-clustering
branch
from
November 3, 2026 16:43
de941ee to
5eecf0d
Compare
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.
Since the batch clustering in 088cd8e,
hitTestcan return the wrongpathfor unnamed nodes. When the renderer reads the program, clustering regroups disjoint siblings of the same kind in lists of eight or more.hitWalkthen reported each hit by its position in the regrouped list. JS reads paths as declared child indices, which is whatHitTestResult.pathdocuments. With eight interleaved rects and circles after a<Fill>,hitTestat the center of the first circle, declared at index 2, returned the path[5].Only unnamed rects, rounded rects, ovals, circles, and images with a solid fill can move. A node with a
refstays in place: the handle turns its geometry into value slots, and clustering never moves a node with slotted geometry. That's whynodewas always right. Headlesssurface.hitTesthad the same problem, since it goes through the same walk.Each
DrawCmdnow keeps its declared index, set where the reader builds the root list and each child list, and the hit walks report that index. Clustering still reorders the draw.I added a harness test with that scene. On a Pixel 9a emulator running Android 16, it failed before the fix with
expected [ 5 ] to deeply equal [ 2 ]and passed three times after it. The other hit-test harness tests still pass. Thetransform3d"nearer face" test fails its center-pixel check on this emulator, with or without this change. I also added a SceneTest case for the root list and for a group's children. It compiles against the tgfx headers, but I couldn't run it, because it needs the private tgfx source.As with #16, I couldn't build the example app for iOS, because Google ML Kit has no arm64 simulator slice for the Xcode 27 simulators.