Skip to content

Commit 412b5d3

Browse files
committed
simplify metrics
1 parent c7ed2d2 commit 412b5d3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -923,19 +923,15 @@ - (void)handleInputAccessoryDoneButton
923923
.selectionRange = [self _selectionRange],
924924
.eventCount = static_cast<int>(_mostRecentEventCount),
925925
#if !TARGET_OS_OSX // [macOS]
926-
.contentOffset = Point{},
927-
.contentInset = EdgeInsets{},
928-
#else // [macOS
929926
.contentOffset = RCTPointFromCGPoint(_backedTextInputView.contentOffset),
930927
.contentInset = RCTEdgeInsetsFromUIEdgeInsets(_backedTextInputView.contentInset),
928+
#else // [macOS
929+
.contentOffset = {.x = 0, .y = 0},
930+
.contentInset = EdgeInsets{},
931931
#endif // macOS]
932932
.contentSize = RCTSizeFromCGSize(_backedTextInputView.contentSize),
933933
.layoutMeasurement = RCTSizeFromCGSize(_backedTextInputView.bounds.size),
934-
#if !TARGET_OS_OSX // [macOS]
935934
.zoomScale = 1,
936-
#else // [macOS
937-
.zoomScale = _backedTextInputView.zoomScale,
938-
#endif // macOS]
939935
};
940936
}
941937

@@ -946,7 +942,7 @@ - (void)handleInputAccessoryDoneButton
946942

947943
if (scrollView) {
948944
metrics.contentOffset = RCTPointFromCGPoint(scrollView.contentOffset);
949-
metrics.contentInset = RCTEdgeInsetsFromUIEdgeInsets(scrollView.contentInset);
945+
metrics.contentInse t = RCTEdgeInsetsFromUIEdgeInsets(scrollView.contentInset);
950946
metrics.contentSize = RCTSizeFromCGSize(scrollView.contentSize);
951947
metrics.layoutMeasurement = RCTSizeFromCGSize(scrollView.bounds.size);
952948
metrics.zoomScale = scrollView.zoomScale ?: 1;

0 commit comments

Comments
 (0)