1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +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); set(Cursor::Map::POINTER);
} }
CursorHandler::~CursorHandler() = default;
Point CursorHandler::position() const Point CursorHandler::position() const
{ {
return pos; return pos;

View File

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