Skip to content

Commit

Permalink
SDF: Fix infinite layout loop (#224)
Browse files Browse the repository at this point in the history
Another hack to prevent an infinite loop situation that was introduced
in v0.8.0.

I've written up an issue to address more wholistically the issues with
the SDF layout engine
- #223

Fixes #220
  • Loading branch information
frank-weindel authored Mar 29, 2024
2 parents f38273b + 2b971d6 commit 1fcbd30
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1fcbd30

Please sign in to comment.