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
This commit is contained in:
Valentin Shergin
2019-05-06 17:01:14 -07:00
committed by Facebook Github Bot
parent 40bf82898f
commit fb85e90487

View File

@@ -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;