Fix exceptions for empty lines

This commit is contained in:
Zihua Li
2023-05-29 21:00:37 +08:00
parent 38d9ebc5da
commit ce9bdcc53f
2 changed files with 13 additions and 0 deletions

View File

@@ -764,6 +764,9 @@ export const calculateTextDimensions: (
let cheight = 0;
const dim = { width: 0, height: 0, lineHeight: 0 };
for (const line of lines) {
if (!line) {
continue;
}
const textObj = getTextObj();
textObj.text = line;
const textElem = drawSimpleText(g, textObj)