1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Formatting fix

This commit is contained in:
Ivan Savenko 2023-05-26 15:58:10 +03:00
parent dc16781877
commit c9d42d59c3
2 changed files with 15 additions and 9 deletions

View File

@ -62,6 +62,8 @@ CursorHandler::CursorHandler()
set(Cursor::Map::POINTER);
}
CursorHandler::~CursorHandler() = default;
Point CursorHandler::position() const
{
return pos;

View File

@ -208,25 +208,29 @@ void EventDispatcher::dispatchTextEditing(const std::string & text)
void EventDispatcher::dispatchMouseMoved(const Point & position)
{
//sending active, hovered hoverable objects hover() call
EventReceiversList hlp;
EventReceiversList newlyHovered;
auto hoverableCopy = hoverable;
for(auto & elem : hoverableCopy)
{
if(elem->isInside(GH.getCursorPosition()))
if(elem->isInside(position))
{
if (!(elem)->isHovered())
hlp.push_back((elem));
if (!elem->isHovered())
{
newlyHovered.push_back((elem));
}
}
else if ((elem)->isHovered())
else
{
(elem)->hover(false);
(elem)->hoveredState = false;
if (elem->isHovered())
{
(elem)->hover(false);
(elem)->hoveredState = false;
}
}
}
for(auto & elem : hlp)
for(auto & elem : newlyHovered)
{
elem->hover(true);
elem->hoveredState = true;