深度画布返回保存
This commit is contained in:
@@ -153,6 +153,7 @@ export class CanvasManager {
|
||||
this.canvas.add(obj)
|
||||
const id = obj?.info?.id || ""
|
||||
if (id) {
|
||||
this.sortActiveObject(obj)
|
||||
await this.layerManager.updateLayers(!!obj.info.parentId)
|
||||
this.renderAll()
|
||||
await this.layerManager.updateLayerThumbnailsById(id)
|
||||
@@ -167,6 +168,19 @@ export class CanvasManager {
|
||||
this.renderAll()
|
||||
}
|
||||
}
|
||||
/** 根据激活对象排序当前对象 */
|
||||
async sortActiveObject(object: any) {
|
||||
const activeID = this.layerManager.activeID.value;
|
||||
if (!activeID) return
|
||||
const activeObject = this.getObjectById(activeID)
|
||||
if (!activeObject) return
|
||||
const parentId = activeObject.info?.parentId
|
||||
if (!object.info.parentId) object.info.parentId = parentId
|
||||
const index = this.getObjects().indexOf(activeObject)
|
||||
this.canvas.moveTo(object, index + 1)
|
||||
// await this.sortObjectByIds(ids, isRecord)
|
||||
}
|
||||
|
||||
|
||||
/** 更新子图层裁剪区域 */
|
||||
async updateSubLayerClipPath() {
|
||||
|
||||
Reference in New Issue
Block a user