feat(编辑能力): 修正文本选框与工具栏布局
build.yaml / build (push) Successful in 54s

This commit is contained in:
xiaoqidun committed 2026-10-14 15:12:01 +08:00
1 parent 6299c0f8f9
commit de229c163b
4 files changed
+47 -13

No files matched your search

+6 -2
View File
@@ -2774,7 +2774,11 @@ func editorRichText(page int, item map[string]any, object ofdgo.GraphicObject, v
return
}
width, height := local.W, local.H
frame := matrix.TransformBox(local)
_, contentBounds, err := currentEditor.LayoutRichText(value, width)
if err != nil {
return
}
frame := matrix.TransformBox(contentBounds)
format, layout := value.Runs[0].Format, value.Layout
var content strings.Builder
for _, run := range value.Runs {
@@ -2792,7 +2796,7 @@ func editorRichText(page int, item map[string]any, object ofdgo.GraphicObject, v
item["letterSpacing"], item["leftIndent"], item["rightIndent"], item["firstLineIndent"] = layout.LetterSpacing, layout.LeftIndent, layout.RightIndent, layout.FirstLineIndent
item["paragraphWidth"], item["bounds"] = width, editorBox(frame)
item["x"], item["y"], item["width"], item["height"] = frame.X, frame.Y, frame.W, frame.H
item["textFrame"] = map[string]any{"width": width, "height": height, "matrix": editorMatrix(matrix)}
item["textFrame"] = map[string]any{"width": width, "height": height, "matrix": editorMatrix(matrix), "content": editorBox(contentBounds)}
capabilities := item["capabilities"].(map[string]any)
for _, key := range []string{"textContent", "rewriteText", "replaceFont", "reflow", "layoutKnown", "paint"} {
capabilities[key] = true