Commit 6f3970db authored by Walter Mollica's avatar Walter Mollica Committed by Albert Astals Cid
Browse files

Extend viewport update area when updating or clearing the a selection rectangle

Extending the viewport update area of the selection rectangle when dragging the mouse while in selection mode or when canceling the selection ensures that no artifacts remain on-screen in either case.

BUG: 266537

Differential Revision: https://phabricator.kde.org/D4487
parent 963ce79c
......@@ -3718,7 +3718,7 @@ void PageView::updateSelection( const QPoint & pos )
d->mouseSelectionRect.setBottomLeft( pos );
updateRect |= d->mouseSelectionRect;
updateRect.translate( -contentAreaPosition() );
viewport()->update( updateRect.adjusted( -1, -1, 1, 1 ) );
viewport()->update( updateRect.adjusted( -1, -2, 2, 1 ) );
}
else if ( d->mouseTextSelecting)
{
......@@ -3796,7 +3796,7 @@ Okular::RegularAreaRect * PageView::textSelectionForItem( PageViewItem * item, c
void PageView::selectionClear(const ClearMode mode)
{
QRect updatedRect = d->mouseSelectionRect.normalized().adjusted( 0, 0, 1, 1 );
QRect updatedRect = d->mouseSelectionRect.normalized().adjusted( -2, -2, 2, 2 );
d->mouseSelecting = false;
d->mouseSelectionRect.setCoords( 0, 0, 0, 0 );
d->tableSelectionCols.clear();
......
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