Only request tile cache to be updated once for both x & y

This commit is contained in:
Ahmed Samy 2013-12-12 16:24:50 +02:00
parent c54015a60d
commit 4f997a3826
1 changed files with 6 additions and 2 deletions

View File

@ -570,18 +570,22 @@ void MapView::move(int x, int y)
m_moveOffset.y += y;
int32_t tmp = m_moveOffset.x / 32;
bool requestTilesUpdate = false;
if(tmp != 0) {
m_customCameraPosition.x += tmp;
m_moveOffset.x %= 32;
requestVisibleTilesCacheUpdate();
requestTilesUpdate = true;
}
tmp = m_moveOffset.y / 32;
if(tmp != 0) {
m_customCameraPosition.y += tmp;
m_moveOffset.y %= 32;
requestVisibleTilesCacheUpdate();
requestTilesUpdate = true;
}
if(requestTilesUpdate)
requestVisibleTilesCacheUpdate();
}
Rect MapView::calcFramebufferSource(const Size& destSize)