瀏覽代碼

创建拆分

tangning 15 小時之前
父節點
當前提交
7a1b541226
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/view/case/photos/canvas-photo-editor.js

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

@@ -429,8 +429,9 @@ export class CanvasPhotoEditor {
       x: this.indexingStartX,
       x: this.indexingStartX,
       y: this.indexingStartY,
       y: this.indexingStartY,
     }, endIindexing1]
     }, endIindexing1]
-    if(Math.abs(this.indexingStartY - endIindexing1.y)>this.rqHeight){//需要折现换行
-      let newX = PhotoIndex.pageIndex*(this.pageWidth + this.pageMargin)
+    if(PhotoIndex.pageIndex != oldPhotoIndex.pageIndex && Math.abs(this.indexingStartY - endIindexing1.y)>this.rqHeight){//需要折现换行
+      let addPage = PhotoIndex.pageIndex>oldPhotoIndex.pageIndex?PhotoIndex.pageIndex:oldPhotoIndex.pageIndex
+      let newX = addPage*(this.pageWidth + this.pageMargin)
       points.splice(1, 0, { x: newX, y: this.indexingStartY }, { x: newX, y: endIindexing1.y })
       points.splice(1, 0, { x: newX, y: this.indexingStartY }, { x: newX, y: endIindexing1.y })
     }
     }
     this.tempArrow.start = null
     this.tempArrow.start = null