mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix on demand mounting in RTL
Summary: Changelog: [internal] When calculating on demand views, RTL layout needs to be considered. Reviewed By: JoshuaGross Differential Revision: D28510293 fbshipit-source-id: 5e7b08fcc5c55fa1a978024a9bfedda705ce1702
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6844b8e0d4
commit
e173bbe3bb
@@ -622,10 +622,11 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
||||
return;
|
||||
}
|
||||
|
||||
CGRect visibleFrame = CGRect{_scrollView.contentOffset, _scrollView.bounds.size};
|
||||
CGRect visibleFrame = [_scrollView convertRect:_scrollView.bounds toView:_containerView];
|
||||
visibleFrame = CGRectInset(visibleFrame, -kClippingLeeway, -kClippingLeeway);
|
||||
|
||||
CGFloat scale = 1.0 / _scrollView.zoomScale;
|
||||
// `zoomScale` is negative in RTL. Absolute value is needed.
|
||||
CGFloat scale = 1.0 / std::abs(_scrollView.zoomScale);
|
||||
visibleFrame.origin.x *= scale;
|
||||
visibleFrame.origin.y *= scale;
|
||||
visibleFrame.size.width *= scale;
|
||||
|
||||
Reference in New Issue
Block a user