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:
commit
915e3f4c5f
2 changed files with 15 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue