1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 07:38:07 +02:00

Merge pull request #9099 from tiriana/allow-dontFlip-in-PDFPageProxy-getViewport

Allows 'dontFlip' as third arg in PDFPageProxy.getViewport
This commit is contained in:
Jonas Jenwald 2018-01-09 18:27:26 +01:00 committed by GitHub
commit 915e3f4c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -979,6 +979,18 @@ describe('api', function() {
expect(viewport.width).toEqual(1262.835);
expect(viewport.height).toEqual(892.92);
});
it('gets viewport respecting "dontFlip" argument', function () {
const scale = 1;
const rotation = 135;
let viewport = page.getViewport(scale, rotation);
let dontFlipViewport = page.getViewport(scale, rotation, true);
expect(dontFlipViewport).not.toEqual(viewport);
expect(dontFlipViewport).toEqual(viewport.clone({ dontFlip: true, }));
expect(viewport.transform).toEqual([1, 0, 0, -1, 0, 841.89]);
expect(dontFlipViewport.transform).toEqual([1, 0, -0, 1, 0, 0]);
});
it('gets annotations', function (done) {
var defaultPromise = page.getAnnotations().then(function (data) {
expect(data.length).toEqual(4);