File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1795,9 +1795,9 @@ export class Draw {
17951795 elementList ,
17961796 i
17971797 )
1798- // 单词宽度大于行可用宽度,无需折行
1798+ // 后面存在元素 && 单词宽度大于行可用宽度,无需折行
17991799 const wordWidth = width * scale
1800- if ( wordWidth <= availableWidth ) {
1800+ if ( endElement && wordWidth <= availableWidth ) {
18011801 curRowWidth += wordWidth
18021802 nextElement = endElement
18031803 }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { Draw } from '../Draw'
1010
1111export interface IMeasureWordResult {
1212 width : number
13- endElement : IElement
13+ endElement : IElement | null
1414}
1515
1616export class TextParticle {
@@ -56,7 +56,7 @@ export class TextParticle {
5656 ) : IMeasureWordResult {
5757 const LETTER_REG = this . draw . getLetterReg ( )
5858 let width = 0
59- let endElement : IElement = elementList [ curIndex ]
59+ let endElement : IElement | null = null
6060 let i = curIndex
6161 while ( i < elementList . length ) {
6262 const element = elementList [ i ]
You can’t perform that action at this time.
0 commit comments