add target node view & set width, height

This commit is contained in:
王劲鹏
2021-02-23 18:26:00 +08:00
committed by osborn
parent 4c0a177747
commit 028334e530
4 changed files with 25 additions and 3 deletions

View File

@@ -9,9 +9,15 @@ void DoricShaderPlugin::render(QJSValue jsValue, QString callbackId) {
QString viewId = jsValue.property("id").toString();
DoricRootNode *rootNode = getContext()->getRootNode();
if (rootNode->getId().isEmpty() && jsValue.property("type").toString() == "Root") {
if (rootNode->getId().isEmpty() &&
jsValue.property("type").toString() == "Root") {
rootNode->setId(viewId);
rootNode->blend(jsValue.property("props"));
} else {
DoricViewNode *viewNode = getContext()->targetViewNode(viewId);
if (viewNode != nullptr) {
viewNode->blend(jsValue.property("props"));
}
}
},
DoricThreadMode::UI);