Skip to content

Commit

Permalink
Fix cxx textlayoutmanager breaking issues.
Browse files Browse the repository at this point in the history
1. Move files into react/renderer/textlayoutmanager/ to support other
   building system. This convention follows Android textlayoutmanager.

2. Add empty TextLayoutManager::measureLines() to fix build error.
  • Loading branch information
Kudo committed Oct 8, 2020
1 parent 8e943d8 commit b11c103
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ReactCommon/react/renderer/textlayoutmanager/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ rn_xplat_cxx_library(
],
cxx_exported_headers = subdir_glob(
[
("platform/cxx", "*.h"),
("platform/cxx/react/renderer/textlayoutmanager", "**/*.h"),
],
prefix = "react/renderer/textlayoutmanager",
),
cxx_headers = subdir_glob(
[
("platform/cxx", "**/*.h"),
("platform/cxx/react/renderer/textlayoutmanager", "**/*.h"),
],
prefix = "",
),
cxx_srcs = glob(
[
"platform/cxx/**/*.cpp",
"platform/cxx/react/renderer/textlayoutmanager/**/*.cpp",
],
),
cxx_tests = [":tests"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,12 @@ TextMeasurement TextLayoutManager::measure(
return TextMeasurement{{0, 0}, {}};
}

LinesMeasurements TextLayoutManager::measureLines(
AttributedString attributedString,
ParagraphAttributes paragraphAttributes,
Size size) const {
return LinesMeasurements{};
}

} // namespace react
} // namespace facebook
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ class TextLayoutManager {
ParagraphAttributes paragraphAttributes,
LayoutConstraints layoutConstraints) const;

/*
* Measures lines of `attributedString` using native text rendering
* infrastructure.
*/
LinesMeasurements measureLines(
AttributedString attributedString,
ParagraphAttributes paragraphAttributes,
Size size) const;

/*
* Returns an opaque pointer to platform-specific TextLayoutManager.
* Is used on a native views layer to delegate text rendering to the manager.
Expand Down

0 comments on commit b11c103

Please sign in to comment.