mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
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:
committed by
Facebook Github Bot
parent
40bf82898f
commit
fb85e90487
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user