Bug 318828

Summary: Wrong ObjectRect after modifying annotation properties in a rotated document
Product: [Applications] okular Reporter: Fabio D'Urso <fabiodurso>
Component: generalAssignee: Okular developers <okular-devel>
Severity: normal CC: fabiodurso, jon.mease
Priority: NOR    
Version: 0.16.60   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In:
Attachments: Example PDF file
Wrong fix

Description Fabio D'Urso 2013-04-25 00:42:44 UTC
After modifying an annotation's properties (i.e. right click -> properties) in a rotated document, its ObjectRect (=the object used for mouse hit testing) gets wrong.
Its normalized coordinates would be correct if the document was not rotated, so it must be a missing rotation somewhere.

This happens on any document, I'm attaching an example one I've made to better explain the issue.

Reproducible: Always

Steps to Reproduce:
1. Open the attached document
2. Rotate it by 90 degrees so that the text looks horizontal
3. Right-click on the annotation and edit some property (e.g. its color)
4. Confirm
5. Notice how right-click no longer works properly: the hitbox now roughly corresponds to the blue area. Right clicks on the upper/lower parts of the ellipse don't "find" the annotation.
Comment 1 Fabio D'Urso 2013-04-25 00:43:50 UTC
Created attachment 79428 [details]
Example PDF file
Comment 2 Fabio D'Urso 2013-04-25 00:59:28 UTC
Created attachment 79429 [details]
Wrong fix

I've tried to fix it myself, and the attached patch indeed fixes the issue, but it's obviously a wrong fix.
Comment 3 Fabio D'Urso 2013-04-25 01:01:29 UTC
Jon, can you have a look at this issue?
Comment 4 Jon Mease 2013-04-26 15:38:08 UTC
Sure thing. May be a few days but I'll take a look soon.
Comment 5 Jon Mease 2013-04-28 01:38:08 UTC
Proposed fix and unit test submitted for review https://git.reviewboard.kde.org/r/110229/
Comment 6 Albert Astals Cid 2013-05-07 20:06:45 UTC
Git commit 4296ac7e5dd579aa43845df80739c6a4f45284db by Albert Astals Cid, on behalf of Jon Mease.
Committed on 07/05/2013 at 22:05.
Pushed by aacid into branch 'master'.

Rotate annotation to match page when setting annotation's properties

M  +3    -0    core/annotations.cpp
M  +30   -0    tests/modifyannotationpropertiestest.cpp