Corrected computation of RCText element height with padding
Summary: Corrected computation of RCText element height with padding (padding was counted twice). See also issue #2466. Closes https://github.com/facebook/react-native/pull/2838 Reviewed By: @svcscm Differential Revision: D2535924 Pulled By: @nicklockwood fb-gh-sync-id: b9527803c0a5a6eed1db7e37c98b628750ab2045
This commit is contained in:
parent
5b425278bb
commit
c73ceff914
|
@ -86,7 +86,10 @@ static css_dim_t RCTMeasure(void *context, float width)
|
|||
parentProperties = [super processUpdatedProperties:applierBlocks
|
||||
parentProperties:parentProperties];
|
||||
|
||||
NSTextStorage *textStorage = [self buildTextStorageForWidth:self.frame.size.width];
|
||||
UIEdgeInsets padding = self.paddingAsInsets;
|
||||
CGFloat width = self.frame.size.width - (padding.left + padding.right);
|
||||
|
||||
NSTextStorage *textStorage = [self buildTextStorageForWidth:width];
|
||||
[applierBlocks addObject:^(RCTSparseArray *viewRegistry) {
|
||||
RCTText *view = viewRegistry[self.reactTag];
|
||||
view.textStorage = textStorage;
|
||||
|
@ -105,9 +108,6 @@ static css_dim_t RCTMeasure(void *context, float width)
|
|||
|
||||
- (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width
|
||||
{
|
||||
UIEdgeInsets padding = self.paddingAsInsets;
|
||||
width -= (padding.left + padding.right);
|
||||
|
||||
if (_cachedTextStorage && width == _cachedTextStorageWidth) {
|
||||
return _cachedTextStorage;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue