From 665fff020e32343fca5f685b384f1ba455b8c4cf Mon Sep 17 00:00:00 2001 From: razh Date: Wed, 10 Jul 2024 02:16:24 -0400 Subject: [PATCH] Fix `ensureMinFontSizeComputed` calculation if `` is a flex container Given: ```css html, body { height: 100%; } body { display: flex; } ``` The `
` appended to the `` 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. --- src/display/text_layer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/display/text_layer.js b/src/display/text_layer.js index e6a20ef65..bace7a87e 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -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,