forked from microsoft/react-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Share TextLayoutManager.h across all platforms (facebook#48210)
Summary: Pull Request resolved: facebook#48210 [Changelog] [Internal] - Share TextLayoutManager.h across all platforms The goal of this change is to enable to share `TextLayoutManager.h` across all platforms, the same we do for: https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/imagemanager/ImageManager.h Reviewed By: philIip Differential Revision: D67064488
- Loading branch information
1 parent
fd5bd3e
commit f5f08b8
Showing
7 changed files
with
58 additions
and
193 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
packages/react-native/ReactCommon/react/renderer/textlayoutmanager/TextLayoutManager.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "TextLayoutManager.h" | ||
|
||
namespace facebook::react { | ||
|
||
Float TextLayoutManager::baseline( | ||
const AttributedStringBox& attributedStringBox, | ||
const ParagraphAttributes& paragraphAttributes, | ||
const Size& size) const { | ||
auto lines = | ||
this->measureLines(attributedStringBox, paragraphAttributes, size); | ||
|
||
if (!lines.empty()) { | ||
return lines[0].ascender; | ||
} else { | ||
return 0; | ||
} | ||
} | ||
|
||
} // namespace facebook::react |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 0 additions & 76 deletions
76
...eact-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
...derer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters