From 2bd1f34c15196968f69d4711613f1c81f1dade68 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Tue, 23 Jul 2024 21:03:47 +0800 Subject: [PATCH] fix: word breaking when scaling the page #666 --- src/editor/core/draw/Draw.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 4c77789..fb4a2c4 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -1573,8 +1573,9 @@ export class Draw { i ) // 单词宽度大于行可用宽度,无需折行 - if (width <= availableWidth) { - curRowWidth += width + const wordWidth = width * scale + if (wordWidth <= availableWidth) { + curRowWidth += wordWidth nextElement = endElement } }