Skip to content

Commit 25a5975

Browse files
authored
fix possible infinite loop when line is undefined (#635)
2 parents c5b1aad + 2310ed6 commit 25a5975

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/text-rendering/sdf/Utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export const measureLines = (
3636

3737
while (remainingLines > 0) {
3838
const line = lines[i];
39+
i++;
40+
remainingLines--;
3941
if (line === undefined) {
4042
continue;
4143
}
4244
const width = measureText(line, fontFamily, designLetterSpacing);
4345
measuredLines.push([line, width]);
44-
i++;
45-
remainingLines--;
4646
}
4747

4848
return [

0 commit comments

Comments
 (0)