diff --git a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm index 50c4965aa2b619..82a762d7895a3b 100644 --- a/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm @@ -38,12 +38,14 @@ - (UIEdgeInsets)_safeAreaInsets return UIEdgeInsetsZero; } +#if !TARGET_OS_OSX // TODO(macOS GH#774) - (void)safeAreaInsetsDidChange { [super safeAreaInsetsDidChange]; [self _updateStateIfNecessary]; } +#endif // TODO(macOS GH#774) - (void)_updateStateIfNecessary { @@ -52,10 +54,18 @@ - (void)_updateStateIfNecessary } UIEdgeInsets insets = [self _safeAreaInsets]; +#if !TARGET_OS_OSX // TODO(macOS GH#774) insets.left = RCTRoundPixelValue(insets.left); insets.top = RCTRoundPixelValue(insets.top); insets.right = RCTRoundPixelValue(insets.right); insets.bottom = RCTRoundPixelValue(insets.bottom); +#else // [TODO(macOS GH#774) + CGFloat scale = [[NSScreen mainScreen] backingScaleFactor];; + insets.left = RCTRoundPixelValue(insets.left, scale); + insets.top = RCTRoundPixelValue(insets.top, scale); + insets.right = RCTRoundPixelValue(insets.right, scale); + insets.bottom = RCTRoundPixelValue(insets.bottom, scale); +#endif // ]TODO(macOS GH#774) auto newPadding = RCTEdgeInsetsFromUIEdgeInsets(insets); auto threshold = 1.0 / RCTScreenScale() + 0.01; // Size of a pixel plus some small threshold. diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm index 844fcb228510a2..d4612954962e5d 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm @@ -57,7 +57,12 @@ - (TextMeasurement)measureNSAttributedString:(NSAttributedString *)attributedStr CGSize size = [layoutManager usedRectForTextContainer:textContainer].size; +#if !TARGET_OS_OSX // TODO(macOS GH#774) size = (CGSize){RCTCeilPixelValue(size.width), RCTCeilPixelValue(size.height)}; +#else // [TODO(macOS GH#774) + CGFloat scale = [[NSScreen mainScreen] backingScaleFactor]; + size = (CGSize){RCTCeilPixelValue(size.width, scale), RCTCeilPixelValue(size.height, scale)}; +#endif // ]TODO(macOS GH#774) __block auto attachments = TextMeasurement::Attachments{};