Skip to content

Commit

Permalink
Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamhong committed Sep 17, 2024
1 parent 81fb2da commit b6683ef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Projects/Skylicht/UserInterface/UserInterface/CUIBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ namespace Skylicht
motions.clear();
}

void CUIBase::resetPointer()
{
m_isPointerHover = false;
m_isPointerDown = false;
}

void CUIBase::convertToUICoordinate(float& pointerX, float& pointerY)
{
CCanvas* canvas = getCanvas();
Expand Down
3 changes: 3 additions & 0 deletions Projects/Skylicht/UserInterface/UserInterface/CUIBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ namespace Skylicht

virtual void onKeyEvent(const SEvent& event);

void resetPointer();

void startMotion(EMotionEvent event);

bool isMotionPlaying(EMotionEvent event);
Expand All @@ -188,6 +190,7 @@ namespace Skylicht
void convertWorldToLocal(CGUIElement* element, float& x, float& y);

void convertLocalToWorld(CGUIElement* element, float& x, float& y);

};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ namespace Skylicht
}
}

if (!m_hover->isEnable())
{
// if call setEnable(false) on pointerEvent
m_hover->resetPointer();
m_hover = NULL;
}

// disable event
return m_hover;
}
Expand Down

0 comments on commit b6683ef

Please sign in to comment.