Files
react-native/ReactCommon/fabric/components/art/group/ARTGroupShadowNode.cpp
T
David Vacca 55c36661d9 Rename Element -> ARTElement
Summary:
Element, Shape, Group, Text are too generic, we are renaming these classes to ARTElement, ARTBGroup, ARTShape...

changelog: [Internal] internal changes to support ART in android

Reviewed By: JoshuaGross

Differential Revision: D21681878

fbshipit-source-id: f6b35443486a3db210f61dcaf91bd32df47fbc66
2020-05-22 01:23:37 -07:00

33 lines
942 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <react/components/art/ARTGroupShadowNode.h>
#include <Glog/logging.h>
#include <react/components/art/ARTElement.h>
#include <react/components/art/ARTGroup.h>
namespace facebook {
namespace react {
extern const char ARTGroupComponentName[] = "ARTGroup";
ARTElement::Shared ARTGroupShadowNode::getARTElement() const {
auto elements = ARTElement::ListOfShared{};
for (auto const &child : getChildren()) {
auto node = std::dynamic_pointer_cast<ARTBaseShadowNode const>(child);
if (node) {
elements.push_back(node->getARTElement());
}
}
auto props = getConcreteProps();
return std::make_shared<ARTGroup>(
props.opacity, props.transform, elements, props.clipping);
}
} // namespace react
} // namespace facebook