Fix width calc with unicode

pull/3/head
Amio 2018-06-23 19:39:25 +08:00
rodzic ce49f1d31c
commit 5063c1b903
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -11,7 +11,7 @@ function calcWidth (charWidthTable) {
return 0
} else {
return Array.from(text).reduce((total, curr) => {
return total + widthTable[curr.charCodeAt()] || widthTable[64] // "@"
return total + (widthTable[curr.charCodeAt()] || widthTable[64]) // "@"
}, 0)
}
}