Commit ff116890 authored by Mailson Menezes's avatar Mailson Menezes

Fix issue of creating an annotation on tiles mode

Sometimes annotations created on tiles mode were not shown immediately.

What requestPixmaps do is given a PixmapRequest, change its
normalizedRect attribute so the rect is tile aligned. However
refreshPixmaps was creating a PixmapRequest with the rect already tile
aligned and then delivering the PixmapRequest to requestPixmaps, which
would trye to take the requested rectangle and change it so it is also
tile aligned. Since the PixmapRequest delivered by refreshPixmaps was
already aligned, the requested rectangle was inflated by the tile
alignment procedure. After that the generated request becomes bigger
than the defined threshold and is discarded. This patch actually
removes the tile alignment logic from refreshPixmaps and let only the
requestPixmaps handle this.
parent 68c9299b
......@@ -1325,23 +1325,18 @@ void DocumentPrivate::refreshPixmaps( int pageNumber )
break;
}
}
const QList<Tile> tiles = tilesManager->tilesAt( visibleRect, TilesManager::TerminalTile );
QList<Tile>::const_iterator tIt = tiles.constBegin(), tEnd = tiles.constEnd();
while ( tIt != tEnd )
{
Tile tile = *tIt;
if ( tilesRect.isNull() )
tilesRect = tile.rect();
else
tilesRect |= tile.rect();
tIt++;
if ( !visibleRect.isNull() )
{
p->setNormalizedRect( visibleRect );
p->setTile( true );
p->d->mForce = true;
requestedPixmaps.push_back( p );
}
else
{
delete p;
}
p->setNormalizedRect( tilesRect );
p->setTile( true );
p->d->mForce = true;
requestedPixmaps.push_back( p );
}
if ( !requestedPixmaps.isEmpty() )
m_parent->requestPixmaps( requestedPixmaps, Okular::Document::NoOption );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment