diff --git a/core/page.cpp b/core/page.cpp --- a/core/page.cpp +++ b/core/page.cpp @@ -368,7 +368,6 @@ 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 @@ for ( ; objectIt != end; ++objectIt ) (*objectIt)->transform( matrix ); + int 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( Okular::buildRotationMatrix( (Rotation)rotation ) ); } }