Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apple/MarkdownTextInputDecoratorShadowNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
extern const char MarkdownTextInputDecoratorViewComponentName[] =
"MarkdownTextInputDecoratorView";

thread_local LayoutContext decoratorLayoutContext{.fontSizeMultiplier =
RCTFontSizeMultiplier()};

void MarkdownTextInputDecoratorShadowNode::initialize() {
// Setting display: contents style results in ForceFlattenView trait being set
// on the shadow node. This trait causes the node not to have a host view. By
Expand Down Expand Up @@ -93,6 +96,7 @@

void MarkdownTextInputDecoratorShadowNode::layout(LayoutContext layoutContext) {
YogaLayoutableShadowNode::layout(layoutContext);
decoratorLayoutContext = layoutContext;

const auto &children = getChildren();
react_native_assert(
Expand Down Expand Up @@ -250,10 +254,8 @@
const auto &decoratorYogaNode = YGNodeGetParent(const_cast<YGNodeRef>(yogaNode));
const auto &decoratorShadowNode = shadowNodeFromContext(decoratorYogaNode);

LayoutContext context{};
context.fontSizeMultiplier = RCTFontSizeMultiplier();

const auto size = decoratorShadowNode.measureContent(context, {minimumSize, maximumSize});
const auto size = decoratorShadowNode.measureContent(
decoratorLayoutContext, {minimumSize, maximumSize});

return YGSize{yogaFloatFromFloat(size.width),
yogaFloatFromFloat(size.height)};
Expand Down
Loading