[api-minor] Move the l10n-translation into the AnnotationLayer
With the changes in PR 16552 we can now move general translation into the `AnnotationLayer` itself, which should improve things ever so slightly in third-party implementations where the default viewer isn't used.
This commit is contained in:
parent
197e806c86
commit
19880fcf9a
@ -2823,7 +2823,7 @@ class AnnotationLayer {
|
|||||||
* @param {AnnotationLayerParameters} params
|
* @param {AnnotationLayerParameters} params
|
||||||
* @memberof AnnotationLayer
|
* @memberof AnnotationLayer
|
||||||
*/
|
*/
|
||||||
render(params) {
|
async render(params) {
|
||||||
const { annotations } = params;
|
const { annotations } = params;
|
||||||
const layer = this.div;
|
const layer = this.div;
|
||||||
setLayerDimensions(layer, this.viewport);
|
setLayerDimensions(layer, this.viewport);
|
||||||
@ -2897,6 +2897,8 @@ class AnnotationLayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.#setAnnotationCanvasMap();
|
this.#setAnnotationCanvasMap();
|
||||||
|
|
||||||
|
await this.l10n.translate(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -235,9 +235,8 @@ class Rasterize {
|
|||||||
l10n,
|
l10n,
|
||||||
viewport: annotationViewport,
|
viewport: annotationViewport,
|
||||||
});
|
});
|
||||||
annotationLayer.render(parameters);
|
await annotationLayer.render(parameters);
|
||||||
await annotationLayer.showPopups();
|
await annotationLayer.showPopups();
|
||||||
await l10n.translate(div);
|
|
||||||
|
|
||||||
// Inline SVG images from text annotations.
|
// Inline SVG images from text annotations.
|
||||||
await inlineImages(div);
|
await inlineImages(div);
|
||||||
|
@ -134,7 +134,7 @@ class AnnotationLayerBuilder {
|
|||||||
viewport: viewport.clone({ dontFlip: true }),
|
viewport: viewport.clone({ dontFlip: true }),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.annotationLayer.render({
|
await this.annotationLayer.render({
|
||||||
annotations,
|
annotations,
|
||||||
imageResourcesPath: this.imageResourcesPath,
|
imageResourcesPath: this.imageResourcesPath,
|
||||||
renderForms: this.renderForms,
|
renderForms: this.renderForms,
|
||||||
@ -145,7 +145,6 @@ class AnnotationLayerBuilder {
|
|||||||
hasJSActions,
|
hasJSActions,
|
||||||
fieldObjects,
|
fieldObjects,
|
||||||
});
|
});
|
||||||
this.l10n.translate(div);
|
|
||||||
|
|
||||||
// Ensure that interactive form elements in the annotationLayer are
|
// Ensure that interactive form elements in the annotationLayer are
|
||||||
// disabled while PresentationMode is active (see issue 12232).
|
// disabled while PresentationMode is active (see issue 12232).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user