-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed annotation getting rotated when moving between pages #18272
base: master
Are you sure you want to change the base?
Fixed annotation getting rotated when moving between pages #18272
Conversation
Is this actually specific to the InkEditor though, since it seems that all Editors are similarly affected? Also, so that this can be reviewed, please squash the commits such that the commit history is clean. |
39e7538
to
497db08
Compare
Seems others are also not working. Checking if I can fix them. @Snuffleupagus |
Firstly, thank you for your contribution and for having found this bug. |
a7638d8
to
eb1f31d
Compare
Fixed for all editor types @Snuffleupagus @calixteman |
Just to know, is there any other way to fix this issue? I'd like to know if there's any other optimized way to do this. @calixteman @Snuffleupagus It would be great to get your feedback on my solution 🙏 |
this.x = (x - layerX) / width; | ||
this.y = (y - layerY) / height; | ||
|
||
if (newRotation === 90) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify the two cases 90 and 270 in using newRotation % 180 !== 0
I added some code to change the spread mode when loading the pdf in the integration tests: |
Overall, it looks good to me but with a test for freetext and ink annotations. |
BUG: It has an issue that dragging an ink annotation between rotated pages causes weird behavior.
How to reproduce:
Open this pdf https://github.com/mozilla/pdf.js/blob/master/test/pdfs/rotation.pdf
Draw ink annotation
Try to drag the ink annotation between rotated pages and it will not work properly.
pdf4.webm