tangning hai 4 días
pai
achega
a4d67f2e56
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      src/view/case/photos/canvas-photo-editor.js

+ 8 - 1
src/view/case/photos/canvas-photo-editor.js

@@ -905,7 +905,7 @@ export class CanvasPhotoEditor {
           : (itemIndex === 0 ? layout.y1 : layout.y2)
         // 图片占位框
         ctx.fillStyle = '#ffffff'
-        ctx.fillRect(pageX + layout.x, itemY, this.rqWidth, layout.height)
+        ctx.fillRect(pageX + layout.x, itemY, layout.width, layout.height)
         // coordinate.push({x: pageX + layout.x, y: itemY, width: layout.width, height:layout.height})
         ctx.strokeStyle = '#fff'
         ctx.lineWidth = 1 / this.scale
@@ -1229,6 +1229,13 @@ export class CanvasPhotoEditor {
   // 把指定页截短,并让后面所有数据自动向后重新排版(每页最大长度 2)
 resizePageAndReflow(pages, pageIndex, itemValue) {
   // 1. 插入
+  if(!pages[pageIndex]){
+    pages[pageIndex] = {
+      layoutMode: this.layoutMode, //页码布局类型
+      list:[],
+      item: []
+    }
+  }
   pages[pageIndex].list.splice(0, 0, itemValue.list);
   pages[pageIndex].item.splice(0, 0, itemValue.item);
   console.log(pages, 'pages')