From 59fe663b382613e8e73ac4f1dd9d3d4c13b451bc Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel Date: Tue, 11 Jun 2024 11:54:39 +0200 Subject: [PATCH] address review --- .../components/scrollview/ScrollViewShadowNode.cpp | 8 +++++--- .../react/renderer/core/LayoutableShadowNode.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp index 7e41ba7b83082a..c098ba02fd4e5f 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp @@ -64,10 +64,12 @@ void ScrollViewShadowNode::layout(LayoutContext layoutContext) { } Point ScrollViewShadowNode::getContentOriginOffset( - bool /* includeTransform */) const { - + bool includeTransform) const { auto stateData = getStateData(); auto contentOffset = stateData.contentOffset; - return {-contentOffset.x, -contentOffset.y + stateData.scrollAwayPaddingTop}; + auto transform = includeTransform ? getTransform() : Transform::Identity(); + auto result = transform * Vector{-contentOffset.x, -contentOffset.y, 0, 1}; + + return {result.x, result.y + stateData.scrollAwayPaddingTop}; } } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp index cef90f40b6923c..524c113c68a02f 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp @@ -193,7 +193,7 @@ Transform LayoutableShadowNode::getTransform() const { } Point LayoutableShadowNode::getContentOriginOffset( - bool /*includeTransform*/) const { + bool includeTransform) const { return {0, 0}; }