-
-
Notifications
You must be signed in to change notification settings - Fork 137
svg: fix nested use nodes #3616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
9615549
to
8812667
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes support for nested <use>
nodes in SVG parsing by implementing recursive resolution of href references. Previously, only single-level <use>
references were supported, causing rendering issues when a <use>
node referenced another element that itself contained <use>
nodes.
Key changes:
- Replaced Array-based postponed element tracking with an Inlist for better traversal control
- Added recursive checking to prevent cloning nodes with unresolved dependencies
- Implemented proper memory management for the new list-based approach
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
src/loaders/svg/tvgSvgLoaderCommon.h | Updated SvgNodeIdPair structure and changed cloneNodes from Array to Inlist |
src/loaders/svg/tvgSvgLoader.cpp | Added recursive dependency checking and updated postponed node processing logic |
05b06fa
to
bc0bf97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previously, only single-level <use> references were supported. If a <use> node pointed to another element that itself contained a <use> node, the reference wasn’t resolved. This has been fixed by replacing the array of postponed elements with a list. The list is traversed, and nodes aren’t cloned while they or any of their children remain unresolved. In such cases, the target element also gets added to the list, enabling recursive resolution of nested href references. issue: #3615
Previously, only single-level references were supported. If a node pointed to another element that itself contained a node, the reference wasn’t resolved.
This has been fixed by replacing the array of postponed elements with a list. The list is traversed, and nodes aren’t cloned while they or any of their children remain unresolved. In such cases, the target element also gets added to the list, enabling recursive resolution of nested href references.
@issue: #3615
samples:
Archiwum.zip
before:

after:
