Skip to content
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

Move rotation normalization from PDFViewerApplication and into BaseViewer #13155

Merged
merged 1 commit into from
Mar 28, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

The rotation handling that's currently living in PDFViewerApplication is very old, and pre-dates the introduction of the viewer components by years.
As can be seen in the BaseViewer.pagesRotation setter, we're not actually normalizing the rotation as intended and instead rely on the caller to handle that correctly. This is first of all inconsistent, given how other setters are implemented, and secondly it could also lead to the rotation being set to a value outside of the [0, 360)-range.

Finally, for improved consistency the rotation handling in PageViewport is updated similarly. Please note that this case, it's not changing the pre-existing logic.

…eViewer`

The rotation handling that's currently living in `PDFViewerApplication` is *very* old, and pre-dates the introduction of the viewer components by years.
As can be seen in the `BaseViewer.pagesRotation` setter, we're not actually normalizing the rotation as intended and instead rely on the caller to handle that correctly. This is first of all inconsistent, given how other setters are implemented, and secondly it could also lead to the rotation being set to a value outside of the `[0, 360)`-range.

Finally, for improved consistency the rotation handling in `PageViewport` is updated similarly. Please note that this case, it's *not* changing the pre-existing logic.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/a526f4013087dbe/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/346f1ca66fa3cfa/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/a526f4013087dbe/output.txt

Total script time: 3.75 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/346f1ca66fa3cfa/output.txt

Total script time: 5.31 mins

  • Unit Tests: Passed

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/a60baf954af4d2a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/a60baf954af4d2a/output.txt

Total script time: 4.33 mins

Published

@timvandermeij timvandermeij merged commit 34542d8 into mozilla:master Mar 28, 2021
@timvandermeij
Copy link
Contributor

Nice find; thanks!

@Snuffleupagus Snuffleupagus deleted the rotation-normalization branch March 28, 2021 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants