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
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ void RNGestureHandlerDetectorShadowNode::layout(LayoutContext layoutContext) {
// Default layout will reset the flag on child nodes.
YogaLayoutableShadowNode::layout(layoutContext);

// No child had its layout changed, we can reuse previous values
if (!anyChildHasNewLayout) {
react_native_assert(previousLayoutMetrics_.has_value());
// No child had its layout changed, we can reuse previous values if available
if (!anyChildHasNewLayout && previousLayoutMetrics_.has_value()) {
setLayoutMetrics(previousLayoutMetrics_.value());
return;
Comment on lines +75 to 78
}
Expand All @@ -101,6 +100,7 @@ void RNGestureHandlerDetectorShadowNode::layout(LayoutContext layoutContext) {
metrics.frame.origin = Point{minX, minY};
metrics.frame.size = Size{maxX - minX, maxY - minY};
setLayoutMetrics(metrics);
previousLayoutMetrics_ = metrics;

// Shift all children so their positions are relative to the detector's origin
for (const auto &child : children) {
Expand Down