-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40547 from software-mansion-labs/@kosmydel/fix-in…
…verted-flat-list Fix inverted flat list
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
patches/react-native+0.73.4+014+fix-inverted-flatlist.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp b/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp | ||
index a8ecce5..6ad790e 100644 | ||
--- a/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp | ||
+++ b/node_modules/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp | ||
@@ -66,7 +66,17 @@ void ScrollViewShadowNode::layout(LayoutContext layoutContext) { | ||
Point ScrollViewShadowNode::getContentOriginOffset() const { | ||
auto stateData = getStateData(); | ||
auto contentOffset = stateData.contentOffset; | ||
- return {-contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop}; | ||
+ auto props = getConcreteProps(); | ||
+ | ||
+ float productX = 1.0f; | ||
+ float productY = 1.0f; | ||
+ | ||
+ for (const auto& operation : props.transform.operations) { | ||
+ productX *= operation.x; | ||
+ productY *= operation.y; | ||
+ } | ||
+ | ||
+ return {-contentOffset.x * productX, (-contentOffset.y + stateData.scrollAwayPaddingTop) * productY}; | ||
} | ||
|
||
} // namespace facebook::react |