From 4d1a0b69f876eada2d0c5d866bd25464d2587a79 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Mon, 22 Apr 2024 21:42:43 +0800 Subject: [PATCH] fix: word break boundary error #521 --- src/editor/core/draw/Draw.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 68f34e1..d659e71 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -1519,8 +1519,11 @@ export class Draw { elementList, i ) - curRowWidth += width - nextElement = endElement + // 单词宽度大于行可用宽度,无需折行 + if (width <= availableWidth) { + curRowWidth += width + nextElement = endElement + } } // 标点符号 curRowWidth += this.textParticle.measurePunctuationWidth(