Skip to content

Commit 6355501

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Back out "fix(ios): Fix rounding error occurring randomly in iOS text line height calculation" (facebook#54510)
Summary: Pull Request resolved: facebook#54510 Original commit changeset: f1b2890ce534 Original Phabricator Diff: D85438723 Original PR: facebook#54260 The original fix broke some internal tests. ## Changelog: [iOS][Changed] - Revert Fix rounding error occurring randomly in iOS text line height calculation Reviewed By: javache Differential Revision: D86791267 fbshipit-source-id: e3466b44cdbb0cbae0d87a7c20fd33658e803b26
1 parent a1e534a commit 6355501

File tree

3 files changed

+2
-333
lines changed

3 files changed

+2
-333
lines changed

packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,8 @@ - (TextMeasurement)_measureTextStorage:(NSTextStorage *)textStorage
388388
size.height = enumeratedLinesHeight;
389389
}
390390

391-
CGFloat epsilon = 0.001;
392-
size = (CGSize){ceil((size.width + epsilon) * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor,
393-
ceil((size.height + epsilon) * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor};
391+
size = (CGSize){ceil(size.width * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor,
392+
ceil(size.height * layoutContext.pointScaleFactor) / layoutContext.pointScaleFactor};
394393

395394
__block auto attachments = TextMeasurement::Attachments{};
396395

packages/rn-tester/js/examples/TextLayout/TextLayoutExample.js

Lines changed: 0 additions & 326 deletions
This file was deleted.

packages/rn-tester/js/utils/RNTesterList.ios.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ const Components: Array<RNTesterModuleInfo> = [
125125
module: require('../examples/TextInput/TextInputExample'),
126126
category: 'Basic',
127127
},
128-
{
129-
key: 'TextLayoutExample',
130-
module: require('../examples/TextLayout/TextLayoutExample'),
131-
},
132128
{
133129
key: 'TouchableExample',
134130
module: require('../examples/Touchable/TouchableExample'),

0 commit comments

Comments
 (0)