From 9702c6395d555532dd5c852d44b92694af7c296c Mon Sep 17 00:00:00 2001 From: yeyinglong_admin Date: Mon, 5 Aug 2024 20:23:13 +0800 Subject: [PATCH] =?UTF-8?q?ArkTS=E7=9A=84=E8=8A=82=E7=82=B9=E6=94=AF?= =?UTF-8?q?=E6=8C=81c-api=E8=AE=BE=E7=BD=AENODE=5FLAYOUT=5FRECT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yeyinglong_admin --- interfaces/native/node/node_model.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/native/node/node_model.cpp b/interfaces/native/node/node_model.cpp index 5e680d4846b..e13ef8b258f 100644 --- a/interfaces/native/node/node_model.cpp +++ b/interfaces/native/node/node_model.cpp @@ -292,7 +292,7 @@ int32_t SetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute, c if (node == nullptr) { return ERROR_CODE_PARAM_INVALID; } - if (node->type == -1) { + if (node->type == -1 && attribute != NODE_LAYOUT_RECT) { return ERROR_CODE_NATIVE_IMPL_BUILDER_NODE_ERROR; } return SetNodeAttribute(node, attribute, value); @@ -303,7 +303,7 @@ int32_t ResetAttribute(ArkUI_NodeHandle node, ArkUI_NodeAttributeType attribute) if (node == nullptr) { return ERROR_CODE_PARAM_INVALID; } - if (node->type == -1) { + if (node->type == -1 && attribute != NODE_LAYOUT_RECT) { return ERROR_CODE_NATIVE_IMPL_BUILDER_NODE_ERROR; } return ResetNodeAttribute(node, attribute);