[Regression] Ensure that documents with varying page sizes are initialized correctly (PR 15812 follow-up)
The rotation-caching added in PR 15812 completely breaks initialization of PDF documents with varying page sizes, causing all pages to wrongly get the same size; see e.g. `sizes.pdf` from the test-suite. To fix that without having to e.g. add a new parameter, which feels error prone, this patch changes the `PDFPageView.#setDimensions` method to completely ignore the rotation-caching until the `setPdfPage`-method has been called.
This commit is contained in:
parent
a575aa13b9
commit
05169efec1
@ -196,7 +196,6 @@ class PDFPageView {
|
|||||||
this.div = div;
|
this.div = div;
|
||||||
|
|
||||||
this.#setDimensions();
|
this.#setDimensions();
|
||||||
|
|
||||||
container?.append(div);
|
container?.append(div);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -230,10 +229,12 @@ class PDFPageView {
|
|||||||
|
|
||||||
#setDimensions() {
|
#setDimensions() {
|
||||||
const { viewport } = this;
|
const { viewport } = this;
|
||||||
if (this.#previousRotation === viewport.rotation) {
|
if (this.pdfPage) {
|
||||||
return;
|
if (this.#previousRotation === viewport.rotation) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.#previousRotation = viewport.rotation;
|
||||||
}
|
}
|
||||||
this.#previousRotation = viewport.rotation;
|
|
||||||
|
|
||||||
setLayerDimensions(
|
setLayerDimensions(
|
||||||
this.div,
|
this.div,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user