update uinode hover semantics

This commit is contained in:
MihailRis 2025-12-10 20:49:50 +03:00
parent 78e0ac5a95
commit 79e4a28b4d
2 changed files with 2 additions and 5 deletions

View file

@ -135,7 +135,7 @@ void GUI::actMouse(float delta, const CursorState& cursor) {
if (this->hover && this->hover != hover) { if (this->hover && this->hover != hover) {
this->hover->setHover(false); this->hover->setHover(false);
} }
if (hover) { if (hover && hover != this->hover) {
hover->setHover(true); hover->setHover(true);
int scroll = input.getScroll(); int scroll = input.getScroll();

View file

@ -48,14 +48,11 @@ void UINode::setAlign(Align align) {
} }
void UINode::setHover(bool flag) { void UINode::setHover(bool flag) {
if (hover == flag) {
return;
}
hover = flag;
actions.notify(flag ? UIAction::MOUSE_ENTER : UIAction::MOUSE_LEAVE, gui); actions.notify(flag ? UIAction::MOUSE_ENTER : UIAction::MOUSE_LEAVE, gui);
} }
void UINode::setMouseOver(bool flag) { void UINode::setMouseOver(bool flag) {
hover = flag;
actions.notify(flag ? UIAction::MOUSE_OVER : UIAction::MOUSE_OUT, gui); actions.notify(flag ? UIAction::MOUSE_OVER : UIAction::MOUSE_OUT, gui);
} }