mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Fabric: LayoutableShadowNode::getTransform
Summary: `LayoutableShadowNode::getTransform` returns a transform object that represents transformations that will/should be applied on top of regular layout metrics by mounting layer. Reviewed By: mdvacca Differential Revision: D15219262 fbshipit-source-id: e7aeb85b5f7e2fce3f8faf9dfcaee5dae3217d36
This commit is contained in:
committed by
Facebook Github Bot
parent
e94b116d76
commit
0e35406e4e
@@ -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
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <react/core/Sealable.h>
|
||||
#include <react/core/ShadowNode.h>
|
||||
#include <react/debug/DebugStringConvertible.h>
|
||||
#include <react/graphics/Transform.h>
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user