Introduce CSSNodeCopyStyle
Summary: - Add a convenience function to copy all style from one node to another. - CSSNodeIsDirty will return true after this function if any style was changed in the destination node. Reviewed By: emilsjolander Differential Revision: D4188514 fbshipit-source-id: af8d7fb5e8688c64aea05ce7ad23fff9233fb441
This commit is contained in:
committed by
Facebook Github Bot
parent
32c175ac55
commit
191ac98b89
@@ -341,6 +341,13 @@ bool CSSNodeIsDirty(const CSSNodeRef node) {
|
||||
return node->isDirty;
|
||||
}
|
||||
|
||||
void CSSNodeCopyStyle(const CSSNodeRef dstNode, const CSSNodeRef srcNode) {
|
||||
if (memcmp(&dstNode->style, &srcNode->style, sizeof(CSSStyle)) != 0) {
|
||||
memcpy(&dstNode->style, &srcNode->style, sizeof(CSSStyle));
|
||||
_CSSNodeMarkDirty(dstNode);
|
||||
}
|
||||
}
|
||||
|
||||
inline float CSSNodeStyleGetFlexGrow(CSSNodeRef node) {
|
||||
if (!CSSValueIsUndefined(node->style.flexGrow)) {
|
||||
return node->style.flexGrow;
|
||||
|
Reference in New Issue
Block a user