mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 14:53:44 +08:00
This commit is contained in:
1 parent
92ddacaf66
commit
e7686b5430
5 files changed
+129
-52
No files matched your search
@@ -732,6 +732,10 @@ func editorObjects(index int, text *ofdgo.PageText) ([]any, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
info, err := currentEditor.PageObjectInfo(index)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
textBoxes := make(map[string]ofdgo.Box)
|
||||
for _, run := range text.Runs {
|
||||
for _, box := range run.Boxes {
|
||||
@@ -770,10 +774,7 @@ func editorObjects(index int, text *ofdgo.PageText) ([]any, error) {
|
||||
default:
|
||||
continue
|
||||
}
|
||||
capability, err := currentEditor.ObjectCapabilities(index, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
capability := info[id].Capabilities
|
||||
var box ofdgo.Box
|
||||
var contours []ofdgo.ObjectContour
|
||||
switch object.Type {
|
||||
@@ -786,10 +787,7 @@ func editorObjects(index int, text *ofdgo.PageText) ([]any, error) {
|
||||
continue
|
||||
}
|
||||
if box.W > 0 && box.H > 0 {
|
||||
position, err := currentEditor.ObjectPosition(index, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
position := info[id].Position
|
||||
item := map[string]any{"id": id, "type": object.Type, "x": box.X, "y": box.Y, "width": box.W, "height": box.H, "order": order, "position": position.Index, "count": position.Count, "container": position.Container,
|
||||
"capabilities": editorCapabilities(capability, object.Type)}
|
||||
editorAppearance(item, object, capability.Paint, editorPathScale(object.PathObject))
|
||||
|
||||
Reference in new issue
Block a user