diff --git a/src/ui/GameWorldView.cpp b/src/ui/GameWorldView.cpp index 689acab..6b7afa6 100644 --- a/src/ui/GameWorldView.cpp +++ b/src/ui/GameWorldView.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -183,9 +184,17 @@ void GameWorldView::onFrame() { const float delta = kScrollSpeedTilesPerSec * static_cast(elapsed) / 1000.0f; + const float scrollBefore = m_scrollXTiles; if (m_scrollLeft) { m_scrollXTiles -= delta; } if (m_scrollRight) { m_scrollXTiles += delta; } clampScroll(); + + // While the view scrolls, the tile under a stationary cursor changes, + // so refresh the box-select rectangle even though no mouse move fires. + if (m_boxSelecting && m_scrollXTiles != scrollBefore) + { + m_boxCurrentTile = widgetToTile(mapFromGlobal(QCursor::pos())); + } } // Fire events for any state that changed since the last frame