1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Fix ensureMinFontSizeComputed calculation if <body> is a flex container

Given:

```css
html,
body {
  height: 100%;
}

body {
  display: flex;
}
```

The `<div>` appended to the `<body>` will take up the full height of the
viewport due to the implicit `align-items: stretch` of flex containers.

This results in an incorrect computed `minFontSize` value.
This commit is contained in:
razh 2024-07-10 02:16:24 -04:00
parent 7ffea2f02a
commit 665fff020e

View file

@ -480,6 +480,7 @@ class TextLayer {
div.style.opacity = 0;
div.style.lineHeight = 1;
div.style.fontSize = "1px";
div.style.position = "absolute";
div.textContent = "X";
document.body.append(div);
// In `display:block` elements contain a single line of text,