Repository navigation
Fix Canvas renderer options, SVG loading, and pointer event semantics - #39
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
馃煛 Changes recommended
Unpainted non-Path objects can intercept events, and imported SVG renderer resources are not fully released.
2 open findings
What changed in this PR
Fixes Canvas options, SVG loading lifecycle, and pointer-event semantics across renderers.
Changes:
- Normalizes renderer aliases and manages mutable/immutable Canvas options.
- Adds abortable SVG loading, shallow imports, ownership cleanup, and stable ordering.
- Reworks coordinates, hit testing, bubbling, pointer capture, and regression coverage.
| File | Description |
|---|---|
lib/鈥婸rovider.tsx |
Updates Canvas lifecycle and event dispatch. |
lib/鈥婨vents.ts |
Implements coordinates, hit testing, and capture APIs. |
lib/鈥婼VG.tsx |
Reworks SVG loading and ownership. |
lib/鈥媢seTwoObject.ts |
Preserves registration across callback updates. |
README.md |
Documents updated behavior. |
tests/鈥媍anvasOptions.test.tsx |
Tests Canvas options. |
tests/鈥媏ventSemantics.test.tsx |
Tests pointer semantics. |
tests/鈥媏vents.test.tsx |
Updates event utility coverage. |
tests/鈥媠vgLifecycle.test.tsx |
Tests SVG lifecycle behavior. |
tests/鈥媌rowser/鈥媔ndex.html |
Adds browser harness UI. |
tests/鈥媌rowser/鈥媟egressions.tsx |
Adds real-renderer regression checks. |
馃 Review effort: Balanced
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Canvas aliases currently fail at construction, SVG loading ignores shallow and leaks lifecycle ownership, and pointer dispatch disagrees with Two.js coordinates and nested scene order. This change fixes all three open bug issues and documents the resulting behavior.
Behavior changes: event.point now uses top-left renderer world coordinates; Group events target the actual leaf; onPointerMissed requires an empty primary down/up sequence. SVG shallow removes only the imported top-level group and its root transforms. Constructor options require a React key remount. Details and dragging examples are in the README.
Validation:
Fixes #8
Fixes #32
Fixes #34