fix(Vectorizer): handle nested SVG in getRelativeTransformation()#3176
Merged
Geliogabalus merged 2 commits intoclientIO:masterfrom Feb 13, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Vectorizer’s relative transform calculation across nested <svg> boundaries by comparing root SVG containers rather than immediate ownerSVGElement, and adds a regression test to cover the scenario.
Changes:
- Add
getRootSVG()helper and use it ingetRelativeTransformation()to support nested SVG hierarchies. - Add QUnit test validating
getTransformToElement()behavior across a nested<svg>. - Update external SVG images example (highlighter options) and add Volta toolchain pins.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/joint-core/src/V/transform.mjs | Adjusts root-SVG comparison logic via getRootSVG() to avoid returning null across nested SVG boundaries. |
| packages/joint-core/test/vectorizer/vectorizer.js | Adds regression test for nested SVG transformation behavior. |
| examples/external-svg-images-js/src/main.js | Changes example highlighter configuration (nonScalingStroke). |
| examples/external-svg-images-js/package.json | Adds Volta toolchain pinning for the example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ped in extra SVG document Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f33f8d9 to
e886d85
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Geliogabalus
approved these changes
Feb 13, 2026
kumilingus
added a commit
to kumilingus/joint
that referenced
this pull request
Feb 13, 2026
…ientIO#3176) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Problem
getRelativeTransformation()returnednullfor elements that span a nested<svg>boundary. This is because it compared the immediateownerSVGElementof each node, which differs when one element is inside a nested<svg>:Calling
V(A).getTransformToElement(B)would returnnullbecauseA.ownerSVGElement(#root) !==B.ownerSVGElement(#nested), even though both elements live in the same document.Fix
getRootSVG()helper that walks theownerSVGElementchain up to the root<svg>, so bothAandBresolve to#rootgetRootSVG()returnsnullfor detached non-SVG elements, andgetRelativeTransformation()handles this gracefully<svg>boundary