From fb85e904879059fda6ed4e656c1860c34359e59f Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 6 May 2019 17:01:14 -0700 Subject: [PATCH] Fabric: Using `LayoutableShadowNode::getTransform` in measuring Summary: After this change, all measuring operations based on `LayoutableShadowNode::getRelativeLayoutMetrics` will take into account the transformation matrices provided by shadow nodes. This will allow implementing scroll-offset-aware and custom-transform-aware measuring. Reviewed By: JoshuaGross, mdvacca Differential Revision: D15219259 fbshipit-source-id: 1d7cd8c0ee4406f4dd0002cd442dc0679391922b --- ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp index 26f7633d5c5..81cc956c9a7 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp @@ -64,8 +64,10 @@ LayoutMetrics LayoutableShadowNode::getRelativeLayoutMetrics( return EmptyLayoutMetrics; } - layoutMetrics.frame.origin += - layoutableCurrentShadowNode->getLayoutMetrics().frame.origin; + auto origin = layoutableCurrentShadowNode->getLayoutMetrics().frame.origin; + auto transform = layoutableCurrentShadowNode->getTransform(); + + layoutMetrics.frame.origin += origin * transform; } return layoutMetrics;