mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
974b515374
commit
67f4cf9d2c
13 files changed
+401
-44
No files matched your search
@@ -146,6 +146,19 @@ func (e *Editor) Snapshot(ctx context.Context) (*Editor, error) {
|
||||
}
|
||||
snapshot.revision, snapshot.serial, snapshot.saveTarget = e.revision, e.serial, e.saveTarget
|
||||
snapshot.backends, snapshot.fontDirs, snapshot.fontFS = e.backends, slices.Clone(e.fontDirs), slices.Clone(e.fontFS)
|
||||
for _, resource := range e.resources {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if resource.font == nil || resource.font.FontFile == "" || !next.fileNames[resource.name] {
|
||||
continue
|
||||
}
|
||||
data, err := next.readFileViewContext(ctx, resource.name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
snapshot.resources = append(snapshot.resources, editorResource{name: resource.name, data: data, font: cloneEditorData(resource.font)})
|
||||
}
|
||||
if e.source != nil {
|
||||
snapshot.source.retiredAttachments = maps.Clone(e.source.retiredAttachments)
|
||||
snapshot.source.removedAttachments = maps.Clone(e.source.removedAttachments)
|
||||
|
||||
Reference in new issue
Block a user