missing tiles in multi-pane spreadsheets

here std::ceil is operating on the result of an int divided by an int
so the input is already an effectively floor-ed int result of the
division so the ceil doesn't do anything

so we end up filtering out some of the invalidates for tiles in frozen
panes.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ibfb25fdfdfb84735ca9410f8250d2e5b9fa1070e
This commit is contained in:
Caolán McNamara 2023-12-20 14:59:29 +00:00 committed by Michael Meeks
parent 434fffa5bb
commit b1ff60ace3

View file

@ -2583,12 +2583,13 @@ void ClientSession::handleTileInvalidation(const std::string& message,
for(int paneIdx = 0; paneIdx < numPanes; ++paneIdx)
{
const Util::Rectangle& normalizedVisArea = paneRects[paneIdx];
int lastVertTile = std::ceil(normalizedVisArea.getBottom() / static_cast<double>(_tileHeightTwips));
int lastHoriTile = std::ceil(normalizedVisArea.getRight() / static_cast<double>(_tileWidthTwips));
// Iterate through visible tiles
for(int i = std::ceil(normalizedVisArea.getTop() / _tileHeightTwips);
i <= std::ceil(normalizedVisArea.getBottom() / _tileHeightTwips); ++i)
for(int i = normalizedVisArea.getTop() / _tileHeightTwips; i <= lastVertTile; ++i)
{
for(int j = std::ceil(normalizedVisArea.getLeft() / _tileWidthTwips);
j <= std::ceil(normalizedVisArea.getRight() / _tileWidthTwips); ++j)
for(int j = normalizedVisArea.getLeft() / _tileWidthTwips; j <= lastHoriTile; ++j)
{
// Find tiles affected by invalidation
Util::Rectangle tileRect (j * _tileWidthTwips, i * _tileHeightTwips, _tileWidthTwips, _tileHeightTwips);