Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -411,22 +411,7 @@ - (CGFloat)lastBaselineForSize:(CGSize)size
}
}];

// Account for stroke width in baseline calculation
__block CGFloat strokeWidth = 0;
[attributedText enumerateAttribute:@"RCTTextStrokeWidth"
inRange:NSMakeRange(0, attributedText.length)
options:0
usingBlock:^(id value, NSRange range, BOOL *stop) {
if (value && [value isKindOfClass:[NSNumber class]]) {
CGFloat width = [value floatValue];
if (width > 0) {
strokeWidth = MAX(strokeWidth, width);
*stop = YES;
}
}
}];

return size.height + maximumDescender + strokeWidth;
return size.height + maximumDescender;
}

static YGSize RCTTextShadowViewMeasure(
Expand Down Expand Up @@ -473,6 +458,7 @@ static YGSize RCTTextShadowViewMeasure(
}];

if (strokeWidth > 0) {
// Stroke does not increase vertcial height of the text to prevent UI shifts.
size.width += strokeWidth;
size.height += strokeWidth;
}
Expand Down
Loading