Commit 6a2ed4f3 authored by Ahmad Osama's avatar Ahmad Osama Committed by Albert Astals Cid
Browse files

[Okular] Bug 387282: Highlighting of search results lost when rotating page

Summary:
The highlights were removed when rotating the page, also the RotaionJob::rotationMatrix function was not rotating the Highlihgts correctly.
I removed the deletion and modified the rotaionMatrix function by making it shorter and adding a translation after the rotatin. I tried different rotations and they are working fine.
BUG: 387282

Reviewers: #okular

Subscribers: aacid, ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D11901
parent 88faff5b
......@@ -368,7 +368,6 @@ void PagePrivate::rotateAt( Rotation orientation )
if ( orientation == m_rotation )
return;
deleteHighlights();
deleteTextSelections();
if ( ( (int)m_orientation + (int)m_rotation ) % 2 != ( (int)m_orientation + (int)orientation ) % 2 )
......@@ -411,10 +410,11 @@ void PagePrivate::rotateAt( Rotation orientation )
for ( ; objectIt != end; ++objectIt )
(*objectIt)->transform( matrix );
const QTransform highlightRotationMatrix = Okular::buildRotationMatrix( (Rotation)(((int)m_rotation - (int)oldRotation + 4) % 4) );
QLinkedList< HighlightAreaRect* >::const_iterator hlIt = m_page->m_highlights.begin(), hlItEnd = m_page->m_highlights.end();
for ( ; hlIt != hlItEnd; ++hlIt )
{
(*hlIt)->transform( RotationJob::rotationMatrix( oldRotation, m_rotation ) );
(*hlIt)->transform( highlightRotationMatrix );
}
}
......
Supports Markdown
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