From 2b971d6acbb84d3e544d8b4c17fec399c5fc53f4 Mon Sep 17 00:00:00 2001 From: Frank Weindel <6070611+frank-weindel@users.noreply.github.com> Date: Fri, 29 Mar 2024 14:25:18 -0400 Subject: [PATCH] SDF: Fix infinite layout loop --- .../renderers/SdfTextRenderer/internal/layoutText.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.ts b/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.ts index 0b1eb565..a1e1e2da 100644 --- a/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.ts +++ b/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.ts @@ -235,6 +235,9 @@ export function layoutText( ); curX = lastWord.xStart; bufferOffset = lastWord.bufferOffset; + // HACK: For the rest of the line when inserting the overflow suffix, + // set contain = 'none' to prevent an infinite loop. + contain = 'none'; } } else { // This glyph fits, so we can add it to the buffer