Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e5422f

Browse files
committed
Fixed text highlight alignment when text has nonzero padding.
Summary: Previously the text highlight overlay did not take padding into account in its positioning, so it would be misaligned for padded text. This fixes that.
1 parent c3d194d commit 0e5422f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Libraries/Text/RCTText.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ - (void)drawRect:(CGRect)rect
103103
_highlightLayer.fillColor = [UIColor colorWithWhite:0 alpha:0.25].CGColor;
104104
[self.layer addSublayer:_highlightLayer];
105105
}
106+
_highlightLayer.position = (CGPoint){_contentInset.left, _contentInset.top};
106107
_highlightLayer.path = highlightPath.CGPath;
107108
} else {
108109
[_highlightLayer removeFromSuperlayer];

0 commit comments

Comments
 (0)