tangning 1 dag sedan
förälder
incheckning
9ea63045a5
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      src/view/case/photos/canvas-photo-editor.js

+ 3 - 2
src/view/case/photos/canvas-photo-editor.js

@@ -165,7 +165,7 @@ export class CanvasPhotoEditor {
     this.resizeCanvas()
     this.resetPosition()
     this.drawDragPreview() // 仅初始化时重绘一次
-    this.saveHistory()
+    // this.saveHistory()
   }
 
   bindScrollWrapper(wrapper) {
@@ -1158,7 +1158,7 @@ export class CanvasPhotoEditor {
     }else{
       const PageIndex = direction ? this.selectedPageIndex + 1 : this.selectedPageIndex;
       newPages.splice(PageIndex, 0, {
-        list: [],
+        list: new Array(layout.count).fill(null),
         layoutMode: this.layoutMode, //页码布局类型
         coordinate: [], //坐标信息
       })
@@ -1174,6 +1174,7 @@ export class CanvasPhotoEditor {
     // if (this.selectedPageIndex === -1) return this.pages
     let newPages = [...this.pages]
     let newPageItem = {}
+    debugger
     const PageIndex = this.selectedPageIndex;
     let list = newPages[PageIndex] && newPages[PageIndex].list?.filter(i => i) || []
     newPages[PageIndex].layoutMode = direction