mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
Formatting fix
This commit is contained in:
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Reference in New Issue
Block a user