accessor: revised the usage with the modern tvg accessor style#33
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Accessor example to use the newer ThorVG accessor workflow for reaching SVG internals, including ID-based traversal and direct lookup of SVG nodes.
Changes:
- Enables SVG internal accessibility on
tvg::Picturebefore loading the SVG. - Reworks the accessor traversal callback to identify and modify a node by SVG ID (
"star"). - Keeps (and clarifies) a second approach using direct access via
picture->paint(tvg::Accessor::id(...)).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
required: thorvg/thorvg#4294 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| picture->accessible = true; // allow accessing to svg internals, it must be set before svg load call. | ||
| picture->load(EXAMPLE_DIR"/svg/favorite_on.svg"); | ||
| picture->size(w, h); | ||
|
|
||
| /* 1. This demonstartes a traversing the internal scene tree of the SVG picture. */ |
There was a problem hiding this comment.
Spelling/grammar in comments: "demonstartes" should be "demonstrates", and the phrasing "allow accessing to svg internals" is ungrammatical (consider "allow access to SVG internals").
| picture->accessible = true; // allow accessing to svg internals, it must be set before svg load call. | |
| picture->load(EXAMPLE_DIR"/svg/favorite_on.svg"); | |
| picture->size(w, h); | |
| /* 1. This demonstartes a traversing the internal scene tree of the SVG picture. */ | |
| picture->accessible = true; // Allow access to SVG internals; it must be set before the SVG load call. | |
| picture->load(EXAMPLE_DIR"/svg/favorite_on.svg"); | |
| picture->size(w, h); | |
| /* 1. This demonstrates traversing the internal scene tree of the SVG picture. */ |
issue: thorvg/thorvg#4217