mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-10 01:15:00 +08:00
Fixed problem in Text measurent on iOS
Summary: See the comment it code. Reviewed By: mmmulani Differential Revision: D7074168 fbshipit-source-id: e6eda9a47552142ccb0ba8e7bd9a103b0cb4f9f9
This commit is contained in:
committed by
Facebook Github Bot
parent
8a073c1d8b
commit
a534672e13
@@ -355,9 +355,12 @@ static YGSize RCTTextShadowViewMeasure(YGNodeRef node, float width, YGMeasureMod
|
||||
MIN(RCTCeilPixelValue(size.height), maximumSize.height)
|
||||
};
|
||||
|
||||
// Adding epsilon value illuminates problems with converting values from
|
||||
// `double` to `float`, and then rounding them to pixel grid in Yoga.
|
||||
CGFloat epsilon = 0.001;
|
||||
return (YGSize){
|
||||
RCTYogaFloatFromCoreGraphicsFloat(size.width),
|
||||
RCTYogaFloatFromCoreGraphicsFloat(size.height)
|
||||
RCTYogaFloatFromCoreGraphicsFloat(size.width + epsilon),
|
||||
RCTYogaFloatFromCoreGraphicsFloat(size.height + epsilon)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user