Limit more SVG-specific code to the GENERIC viewer
Given that the SVG back-end is not defined anywhere except in GENERIC builds, we can remove a little bit more unnecessary code in e.g. the Firefox PDF Viewer.
This commit is contained in:
parent
90bf659b29
commit
290aeaf755
@ -1795,10 +1795,17 @@ const PDFViewerApplication = {
|
||||
this.pdfViewer.cleanup();
|
||||
this.pdfThumbnailViewer.cleanup();
|
||||
|
||||
if (
|
||||
typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")
|
||||
) {
|
||||
// We don't want to remove fonts used by active page SVGs.
|
||||
this.pdfDocument.cleanup(
|
||||
/* keepLoadedFonts = */ this.pdfViewer.renderer === RendererType.SVG
|
||||
);
|
||||
} else {
|
||||
this.pdfDocument.cleanup();
|
||||
}
|
||||
},
|
||||
|
||||
forceRendering() {
|
||||
|
@ -344,7 +344,11 @@ class PDFPageView {
|
||||
}
|
||||
this._resetZoomLayer();
|
||||
}
|
||||
if (this.svg) {
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
|
||||
this.svg
|
||||
) {
|
||||
this.paintedViewportMap.delete(this.svg);
|
||||
delete this.svg;
|
||||
}
|
||||
@ -380,7 +384,11 @@ class PDFPageView {
|
||||
docStyle.setProperty("--scale-factor", this.viewport.scale);
|
||||
}
|
||||
|
||||
if (this.svg) {
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
|
||||
this.svg
|
||||
) {
|
||||
this.cssTransform({
|
||||
target: this.svg,
|
||||
redrawAnnotationLayer: true,
|
||||
@ -733,6 +741,8 @@ class PDFPageView {
|
||||
};
|
||||
|
||||
const paintTask =
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
|
||||
this.renderer === RendererType.SVG
|
||||
? this.paintOnSvg(canvasWrapper)
|
||||
: this.paintOnCanvas(canvasWrapper);
|
||||
|
Loading…
Reference in New Issue
Block a user