diff --git a/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h b/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h index f1be7bbff..09d45069a 100644 --- a/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h +++ b/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h @@ -117,6 +117,10 @@ class ConcreteViewShadowNode : public ConcreteShadowNode< return clonedChildShadowNode.get(); } + Transform getTransform() const override { + return BaseShadowNode::getProps()->transform; + } + #pragma mark - DebugStringConvertible #if RN_DEBUG_STRING_CONVERTIBLE diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp index 5ebcf8c0e..26f7633d5 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp @@ -36,6 +36,10 @@ bool LayoutableShadowNode::LayoutableShadowNode::isLayoutOnly() const { return false; } +Transform LayoutableShadowNode::getTransform() const { + return Transform::Identity(); +} + LayoutMetrics LayoutableShadowNode::getRelativeLayoutMetrics( const LayoutableShadowNode &ancestorLayoutableShadowNode) const { auto &ancestorShadowNode = diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h index 569bc677d..d28561cce 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace facebook { namespace react { @@ -64,6 +65,14 @@ class LayoutableShadowNode : public virtual Sealable { */ virtual bool isLayoutOnly() const; + /* + * Returns a transform object that represents transformations that will/should + * be applied on top of regular layout metrics by mounting layer. + * The `transform` value modifies a coordinate space of a layout system. + * Default implementation returns `Identity` transform. + */ + virtual Transform getTransform() const; + /* * Returns layout metrics relatively to the given ancestor node. */