mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-26 04:19:17 +00:00
Ensure that getTextRoot and getGlyphContext works correctly independent of if it is wrapped by a G element or not
This commit is contained in:
@@ -39,11 +39,20 @@ public class GroupShadowNode extends RenderableShadowNode {
|
||||
}
|
||||
|
||||
protected GroupShadowNode getTextRoot() {
|
||||
GroupShadowNode shadowNode = getShadowNode(GroupShadowNode.class);
|
||||
if (shadowNode == null) {
|
||||
return getShadowNode(TextShadowNode.class);
|
||||
}
|
||||
return shadowNode;
|
||||
}
|
||||
|
||||
@android.support.annotation.Nullable
|
||||
private GroupShadowNode getShadowNode(Class shadowNodeClass) {
|
||||
if (mTextRoot == null) {
|
||||
mTextRoot = this;
|
||||
|
||||
while (mTextRoot != null) {
|
||||
if (mTextRoot.getClass() == GroupShadowNode.class) {
|
||||
if (mTextRoot.getClass() == shadowNodeClass) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -66,6 +75,9 @@ public class GroupShadowNode extends RenderableShadowNode {
|
||||
}
|
||||
|
||||
protected GlyphContext getGlyphContext() {
|
||||
if (mGlyphContext == null) {
|
||||
setupGlyphContext();
|
||||
}
|
||||
return mGlyphContext;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user