mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
fix recursive iframe
This commit is contained in:
parent
4f1411b005
commit
c3b50b5ab2
3 changed files with 10 additions and 1 deletions
|
|
@ -25,8 +25,12 @@ void InlineFrame::setDocument(const std::shared_ptr<UiDocument>& document) {
|
||||||
if (document == nullptr) {
|
if (document == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
auto newRoot = document->getRoot();
|
||||||
|
if (newRoot->hasParent()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this->document = document;
|
this->document = document;
|
||||||
this->root = document->getRoot();
|
this->root = std::move(newRoot);
|
||||||
add(root);
|
add(root);
|
||||||
|
|
||||||
root->setSize(size);
|
root->setSize(size);
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,10 @@ bool UINode::isHover() const {
|
||||||
return hover;
|
return hover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UINode::hasParent() const {
|
||||||
|
return parent != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void UINode::setParent(UINode* node) {
|
void UINode::setParent(UINode* node) {
|
||||||
parent = node;
|
parent = node;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ namespace gui {
|
||||||
void setMouseOver(bool flag);
|
void setMouseOver(bool flag);
|
||||||
|
|
||||||
virtual void setParent(UINode* node);
|
virtual void setParent(UINode* node);
|
||||||
|
bool hasParent() const;
|
||||||
UINode* getParent() const;
|
UINode* getParent() const;
|
||||||
std::shared_ptr<UINode> getParentShared() const;
|
std::shared_ptr<UINode> getParentShared() const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue