fix: tooltip visibility when cursor is hidden
This commit is contained in:
@@ -13,6 +13,9 @@ UINode::~UINode() {
|
||||
}
|
||||
|
||||
bool UINode::isVisible() const {
|
||||
if (visible && parent) {
|
||||
return parent->isVisible();
|
||||
}
|
||||
return visible;
|
||||
}
|
||||
|
||||
@@ -107,7 +110,7 @@ bool UINode::isInside(glm::vec2 point) {
|
||||
}
|
||||
|
||||
std::shared_ptr<UINode> UINode::getAt(glm::vec2 point, std::shared_ptr<UINode> self) {
|
||||
if (!interactive || !enabled) {
|
||||
if (!isInteractive() || !enabled) {
|
||||
return nullptr;
|
||||
}
|
||||
return isInside(point) ? self : nullptr;
|
||||
@@ -145,7 +148,6 @@ float UINode::getTooltipDelay() const {
|
||||
return tooltipDelay;
|
||||
}
|
||||
|
||||
|
||||
glm::vec2 UINode::calcPos() const {
|
||||
if (parent) {
|
||||
return pos + parent->calcPos() + parent->contentOffset();
|
||||
@@ -332,6 +334,16 @@ void UINode::setGravity(Gravity gravity) {
|
||||
}
|
||||
}
|
||||
|
||||
bool UINode::isSubnodeOf(const UINode* node) {
|
||||
if (parent == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (parent == node) {
|
||||
return true;
|
||||
}
|
||||
return parent->isSubnodeOf(node);
|
||||
}
|
||||
|
||||
void UINode::getIndices(
|
||||
const std::shared_ptr<UINode> node,
|
||||
std::unordered_map<std::string, std::shared_ptr<UINode>>& map
|
||||
|
||||
Reference in New Issue
Block a user