feat(编辑能力): 完善复合对象编辑,修复撤销后的粘贴路径和裁剪状态
build.yaml / build (push) Successful in 37s

This commit is contained in:
xiaoqidun committed 2026-09-17 18:05:16 +08:00
1 parent 2ddde73b65
commit fa8fec9830
9 files changed
+737 -71

No files matched your search

+4 -1
View File
@@ -62,13 +62,14 @@ type editorSourcePage struct {
// Update表示完整替换内容,ReplaceFont表示可显式替换文字字体,Transform表示保留文字定位的几何变换,Order仅限同一图层或末级页块
// Arrange表示可准确度量对齐与旋转范围;Reflow表示可重排文字,LayoutKnown表示段落选项可恢复
// Paint表示可独立修改纯色填充和描边,不要求重新排版文字
// ReplaceImage表示可替换图片数据,内部成员保留原布局,不开放裁剪或重新适应
// ReplaceImage表示可替换图片数据,CropImage表示可裁剪图片;内部裁剪与原裁剪取交集
// MissingGlyphs提供缺字导致操作受限时的结构化诊断
type ObjectCapabilities struct {
Update bool
Paint bool
ReplaceFont bool
ReplaceImage bool
CropImage bool
Reflow bool
LayoutKnown bool
Transform bool
@@ -358,6 +359,7 @@ func (e *Editor) ObjectCapabilities(page int, id string) (ObjectCapabilities, er
origin := e.objectOrigin(id)
if origin == nil {
all.ReplaceImage = object.Type == "ImageObject"
all.CropImage = all.ReplaceImage
return all, nil
}
node := origin.node
@@ -388,6 +390,7 @@ func (e *Editor) ObjectCapabilities(page int, id string) (ObjectCapabilities, er
}
all.Paint = all.Paint && e.editorPaintable(object)
all.ReplaceImage = all.Update && object.Type == "ImageObject"
all.CropImage = all.ReplaceImage
if object.Type == "ImageObject" && object.ImageObject.Border != nil && len(object.ImageObject.Actions) != 0 {
all.Transform, all.Arrange = false, false
all.Reason, all.ReasonCode = "image actions cannot be transformed together with the border", EditUnsupportedObject