Pass layoutDirection to surface handler

Summary:
Changelog: [internal]

During transition to SurfaceHandler, layoutDirection got lost. This diff adds it back.

Reviewed By: JoshuaGross

Differential Revision: D26775873

fbshipit-source-id: 9b638b4c2a41eb887312b968a2e113c5fcd7463d
This commit is contained in:
Samuel Susla authored and Facebook GitHub Bot committed 2021-03-04 02:19:00 -08:00
1 parent 305b4253c2
commit 542c7cc357
2 files changed
+5

No files matched your search

+2
View File
@@ -168,6 +168,8 @@ using namespace facebook::react;
- (void)_updateLayoutContext
{
auto layoutConstraints = _surfaceHandler->getLayoutConstraints();
layoutConstraints.layoutDirection = RCTLayoutDirection([[RCTI18nUtil sharedInstance] isRTL]);
auto layoutContext = _surfaceHandler->getLayoutContext();
layoutContext.pointScaleFactor = RCTScreenScale();
@@ -58,6 +58,9 @@ void SurfaceHandler::start() const noexcept {
std::unique_lock<better::shared_mutex> lock(linkMutex_);
react_native_assert(
link_.status == Status::Registered && "Surface must be registered.");
react_native_assert(
getLayoutConstraints().layoutDirection != LayoutDirection::Undefined &&
"layoutDirection must be set.");
auto parameters = Parameters{};
{