fix calculating text width for indented text (#930)

This commit is contained in:
David Luzar 2020-03-13 15:10:44 +01:00 committed by GitHub
parent 450a024f5c
commit c85315650f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ export function measureText(text: string, font: string) {
const line = document.createElement("div");
const body = document.body;
line.style.position = "absolute";
line.style.whiteSpace = "nowrap";
line.style.whiteSpace = "pre";
line.style.font = font;
body.appendChild(line);
// Now we can measure width and height of the letter