feat(编辑能力): 完善页面、目录与对象样式编辑,优化轮廓选中和撤销体验
build.yaml / build (push) Successful in 36s

This commit is contained in:
xiaoqidun committed 2026-09-17 00:06:12 +08:00
1 parent ee48ca666d
commit 4a6174c2ae
12 files changed
+1249 -101

No files matched your search

+22
View File
@@ -19,8 +19,30 @@ import (
"math"
"strconv"
"strings"
"github.com/tdewolff/canvas"
)
// Outline 获取页面坐标系中的SVG路径轮廓,不包含描边宽度和填充
// 入参: p 路径对象
// 返回: string SVG路径数据, error 错误信息
func (p PathObject) Outline() (string, error) {
if err := creationPath(p.AbbreviatedData); err != nil {
return "", err
}
if _, err := creationBox(p.Boundary); err != nil {
return "", err
}
if p.CTM != "" {
if _, err := creationNumbers(p.CTM, 6); err != nil {
return "", err
}
}
r := &Renderer{}
path := r.buildPath(p, 0, NewMatrix(p.CTM), false)
return path.Transform(canvas.Matrix{{1, 0, 0}, {0, -1, 0}}).ToSVG(), nil
}
// ShapeKind 基本图形类型
type ShapeKind string