Мелкий рефакторинг, поправки парсера

This commit is contained in:
Book Pauk
2019-01-16 21:33:31 +07:00
parent d56ece5d3a
commit 7fe41d6f77
2 changed files with 7 additions and 9 deletions

View File

@@ -160,8 +160,8 @@ class TextPage extends Vue {
if (this.textAlignJustify && !line.last) {
const words = text.split(' ');
if (words.length > 1) {
let space = canvas.width - line.width + spaceWidth*(words.length - 1);
space = space/(words.length - 1);
const spaceCount = words.length - 1;
const space = (canvas.width - line.width + spaceWidth*spaceCount)/spaceCount;
let x = 0;
for (const word of words) {