Skip to content

Commit

Permalink
fix: rendering error when line break appears at the beginning of text (
Browse files Browse the repository at this point in the history
  • Loading branch information
wang1212 authored Dec 18, 2024
1 parent fad9325 commit 2d71558
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/two-pumpkins-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/g-lite': patch
---

fix: rendering error when line break appears at the beginning of text
2 changes: 1 addition & 1 deletion packages/g-lite/src/services/TextService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export class TextService {
}

// Backspace from line's end.
const currentLineLength = lines[lineIndex].length;
const currentLineLength = lines[lineIndex] ? lines[lineIndex].length : 0;
let lastLineWidth = 0;
let lastLineIndex = currentLineLength;
for (let i = 0; i < currentLineLength; i++) {
Expand Down

0 comments on commit 2d71558

Please sign in to comment.