feat(创建写入): 完善画布编辑状态保护,优化离屏页面回收
build.yaml / build (push) Successful in 38s

This commit is contained in:
xiaoqidun committed 2026-09-15 18:19:21 +08:00
1 parent e9d9ba0add
commit cfcf1939d1
9 files changed
+503 -99

No files matched your search

+2 -9
View File
@@ -204,15 +204,8 @@ func foldText(text string) string {
// 入参: obj 文本对象
// 返回: *TextRun 文本及待填充的字符区域
func (p *PageText) addRun(obj TextObject) *TextRun {
var text strings.Builder
for _, code := range obj.TextCode {
if code.Index == "" {
text.WriteString(string(textCodeRunes(code.Value)))
} else {
text.WriteRune('\uFFFC')
}
}
p.Runs = append(p.Runs, TextRun{ID: obj.ID, Text: text.String(), Boxes: make([]Box, utf8.RuneCountInString(text.String()))})
text := obj.Text()
p.Runs = append(p.Runs, TextRun{ID: obj.ID, Text: text, Boxes: make([]Box, utf8.RuneCountInString(text))})
return &p.Runs[len(p.Runs)-1]
}