Improved anchored text chunk logic #570

This commit is contained in:
Mikael Sand
2019-03-21 18:21:40 +02:00
parent eaec9b9988
commit 70ac80b297
2 changed files with 3 additions and 2 deletions
@@ -221,7 +221,7 @@ class TextView extends GroupView {
TextView node = this;
ViewParent parent = this.getParent();
for (int i = font.size() - 1; i >= 0; i--) {
if (!(parent instanceof TextView) || font.get(i).textAnchor == TextProperties.TextAnchor.start) {
if (!(parent instanceof TextView) || font.get(i).textAnchor == TextProperties.TextAnchor.start || node.mPositionX != null) {
return node;
}
node = (TextView) parent;
+2 -1
View File
@@ -264,7 +264,8 @@
for (NSInteger i = [font count] - 1; i >= 0; i--) {
RNSVGFontData* fontData = [font objectAtIndex:i];
if (![parent isKindOfClass:[RNSVGText class]] ||
fontData->textAnchor == RNSVGTextAnchorStart) {
fontData->textAnchor == RNSVGTextAnchorStart ||
node.positionX != nil) {
return node;
}
node = (RNSVGText*) parent;