1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Do not cache hovered tile and always update state

This commit is contained in:
Ivan Savenko
2023-03-22 19:49:57 +02:00
parent fa9abf6adc
commit 8af76947cb
3 changed files with 11 additions and 30 deletions

View File

@@ -24,7 +24,6 @@
MapViewActions::MapViewActions(MapView & owner, const std::shared_ptr<MapViewModel> & model)
: model(model)
, owner(owner)
, curHoveredTile(-1, -1, -1)
, isSwiping(false)
{
pos.w = model->getPixelsVisibleDimensions().x;
@@ -47,17 +46,6 @@ void MapViewActions::setContext(const std::shared_ptr<IMapRendererContext> & con
this->context = context;
}
void MapViewActions::activate()
{
CIntObject::activate();
}
void MapViewActions::deactivate()
{
CIntObject::deactivate();
curHoveredTile = int3(-1, -1, -1); //we lost info about hovered tile when disabling
}
void MapViewActions::clickLeft(tribool down, bool previousState)
{
if(indeterminate(down))
@@ -159,11 +147,7 @@ void MapViewActions::handleHover(const Point & cursorPosition)
return;
}
if(tile != curHoveredTile)
{
curHoveredTile = tile;
adventureInt->onTileHovered(tile);
}
adventureInt->onTileHovered(tile);
}
void MapViewActions::hover(bool on)