mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +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();
|
return clonedChildShadowNode.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Transform getTransform() const override {
|
||||||
|
return BaseShadowNode::getProps()->transform;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - DebugStringConvertible
|
#pragma mark - DebugStringConvertible
|
||||||
|
|
||||||
#if RN_DEBUG_STRING_CONVERTIBLE
|
#if RN_DEBUG_STRING_CONVERTIBLE
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ bool LayoutableShadowNode::LayoutableShadowNode::isLayoutOnly() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Transform LayoutableShadowNode::getTransform() const {
|
||||||
|
return Transform::Identity();
|
||||||
|
}
|
||||||
|
|
||||||
LayoutMetrics LayoutableShadowNode::getRelativeLayoutMetrics(
|
LayoutMetrics LayoutableShadowNode::getRelativeLayoutMetrics(
|
||||||
const LayoutableShadowNode &ancestorLayoutableShadowNode) const {
|
const LayoutableShadowNode &ancestorLayoutableShadowNode) const {
|
||||||
auto &ancestorShadowNode =
|
auto &ancestorShadowNode =
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include <react/core/Sealable.h>
|
#include <react/core/Sealable.h>
|
||||||
#include <react/core/ShadowNode.h>
|
#include <react/core/ShadowNode.h>
|
||||||
#include <react/debug/DebugStringConvertible.h>
|
#include <react/debug/DebugStringConvertible.h>
|
||||||
|
#include <react/graphics/Transform.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace react {
|
namespace react {
|
||||||
@@ -64,6 +65,14 @@ class LayoutableShadowNode : public virtual Sealable {
|
|||||||
*/
|
*/
|
||||||
virtual bool isLayoutOnly() const;
|
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.
|
* Returns layout metrics relatively to the given ancestor node.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user