Inherit Defs from Parent SVG
#1.284 aberto em 13 de fev. de 2020
Métricas do repositório
- Stars
- (7.107 stars)
- Métricas de merge de PR
- (Mesclagem média 9d 18h) (1 fundiu PR em 30d)
Description
Feature Request
On the web, if you have an svg within another svg, you can reference the defs in the parent svg from the child - ids are global after all
Take this example,
<svg>
<defs>
<path id="a" d="…"/>
<path id="b" d="…"/>
<path id="c" d="…"/>
</defs>
<use href="#a"/>
<svg x=…>
<use href="#b"/>
</svg>
<use href="#c"/>
</svg>
This crashes - and it does make sense why it does
But it might be possible to fix this use-case by allowing the child to look up through the svg parents to find the relevant area
Why it is needed
This shows up a lot with the new mathjax 3 svg output using fontCache: 'local' - large brackets are represented in the same format as the example I gave above
Possible implementation
If RNSVGSvgView held an optional reference to a parent svg, this might be possible. Unsure of Android implementation
Code sample
Refer to the above code sample