ahmadosama added a comment.
I have not tested it, I do not know what on the page should be rotated when rotating m_page->m_rects, I still trying to find out. What I did is that I replaced: (*hlIt)->transform( RotationJob::rotationMatrix( oldRotation, m_rotation ) ); with: (*hlIt)->transform( matrix ); but the highlights were rotated correctly only from the original position. But, I think that m_page->m_rects may not be rotated correctly because Okular::buildRotationMatrix(Rotation rotation), rotates only based on the new rotation and does not consider what the previous rotation was. REPOSITORY R223 Okular REVISION DETAIL https://phabricator.kde.org/D11901 To: ahmadosama, #okular Cc: aacid, ngraham, #okular, michaelweghorn