mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Warn about missing/incorrect --scale-factor
CSS-variable in renderTextLayer
(issue 16139)
Unfortunately I don't believe that we can simply add a default `--scale-factor` CSS-variable to the `container`-element, since that might not be entirely appropriate/correct in all cases.[1] However, we can at least print a console-error to hopefully make this situation more apparent to users. (This is purposely not using the `warn` helper-function, since those messages can be disabled.) --- [1] One example is in our reference-tests, where we don't need to add it to the `container`-element itself.
This commit is contained in:
parent
5e4b3d13eb
commit
0e54a3c37a
2 changed files with 14 additions and 1 deletions
|
@ -35,7 +35,7 @@ describe("textLayer", function () {
|
|||
const textLayerRenderTask = renderTextLayer({
|
||||
textContentSource: page.streamTextContent(),
|
||||
container: document.createElement("div"),
|
||||
viewport: page.getViewport(),
|
||||
viewport: page.getViewport({ scale: 1 }),
|
||||
textContentItemsStr,
|
||||
});
|
||||
expect(textLayerRenderTask instanceof TextLayerRenderTask).toEqual(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue