|
|
@@ -275,7 +275,7 @@ export class CanvasPhotoEditor {
|
|
|
if(this.dragPageData.drawing){
|
|
|
let endIndex = Math.round(mouseX / this.pageWidth)
|
|
|
this.dragPageData.end = { x: mouseX, y: mouseY }
|
|
|
- let newEndIndex = endIndex<0?0:endIndex>this.pages.length-1?this.pages.length-1:endIndex
|
|
|
+ let newEndIndex = endIndex<-1?-1:endIndex>this.pages.length-1?this.pages.length:endIndex
|
|
|
if(newEndIndex != this.dragPageData.movedIndex){
|
|
|
this.dragPageData.movedIndex = newEndIndex
|
|
|
this.drawAllPages()
|
|
|
@@ -337,10 +337,12 @@ export class CanvasPhotoEditor {
|
|
|
console.log('handleMouseUpdragPageData', this.dragPageData)
|
|
|
let newPagelist = this.moveItem(this.pages, this.dragPageData.index, this.dragPageData.movedIndex)
|
|
|
this.pages = newPagelist;
|
|
|
+ this.dragPageData.drawing = false//退出page编辑模式
|
|
|
+ this.dragPageData.movedIndex = -1
|
|
|
this.drawAllPages()
|
|
|
}
|
|
|
this.dragPageData.drawing = false
|
|
|
- this.dragPageData.movedIndex = 0
|
|
|
+ this.dragPageData.movedIndex = -1
|
|
|
this.dragPageData.index = 0
|
|
|
// 松开鼠标后仅重绘一次,确认最终位置
|
|
|
// this.drawDragPreview()
|
|
|
@@ -929,11 +931,11 @@ export class CanvasPhotoEditor {
|
|
|
})
|
|
|
})
|
|
|
ctx.restore()
|
|
|
- console.log('this.tempArrow', this.selectedPageItem)
|
|
|
+ console.log('this.dragPageData', this.dragPageData)
|
|
|
if(this.tempArrow.drawing && this.indexing){//绘制实时鼠标标引
|
|
|
this.drawInterimLine([this.tempArrow.start,this.tempArrow.end])
|
|
|
}
|
|
|
- if(this.dragPageData.drawing && this.dragPageData.movedIndex){//绘制拖拽标志
|
|
|
+ if(this.dragPageData.drawing && this.dragPageData.movedIndex > -1){//绘制拖拽标志
|
|
|
this.drawPlusIcon(this.dragPageData.movedIndex)
|
|
|
}
|
|
|
this.drawGuideLineAll(true)//绘制标引
|
|
|
@@ -963,7 +965,6 @@ export class CanvasPhotoEditor {
|
|
|
// if (!photo) return
|
|
|
|
|
|
let img = this.imgCache.get(photoId)
|
|
|
- console.log(img, photo,'imgCache', this.photos)
|
|
|
if (!img && photo && photo.url) {
|
|
|
img = new Image()
|
|
|
img.crossOrigin = 'anonymous'
|