From cad54b42501844eba266299c91f9cbc96ad7d52c Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel Date: Wed, 8 May 2024 17:07:03 +0200 Subject: [PATCH] refactor: change where transform is applied --- .../components/scrollview/ScrollViewShadowNode.cpp | 7 +------ .../react/renderer/core/LayoutableShadowNode.cpp | 1 - 2 files changed, 1 insertion(+), 7 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 cc74b9fb15b0c5..7e41ba7b83082a 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp @@ -68,11 +68,6 @@ Point ScrollViewShadowNode::getContentOriginOffset( auto stateData = getStateData(); auto contentOffset = stateData.contentOffset; - - const auto& props = getConcreteProps(); - auto result = props.resolveTransform(layoutMetrics_) * Vector{-contentOffset.x, -contentOffset.y, 0, 1}; - - return {result.x, result.y + stateData.scrollAwayPaddingTop}; + return {-contentOffset.x, -contentOffset.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 2756ea30769065..cef90f40b6923c 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp @@ -194,7 +194,6 @@ Transform LayoutableShadowNode::getTransform() const { Point LayoutableShadowNode::getContentOriginOffset( bool /*includeTransform*/) const { - return {0, 0}; }