Commit 9e7a1ad3 authored by christianrhansen's avatar christianrhansen

clean-up panGrid()

parent 3347d83b
......@@ -500,27 +500,30 @@
},
panGrid (obj) {
if (this.cachedNewCell && !this.mobileTempCell.onGrid) {
// console.log('hhhhhhhhhhhhhhhhh', obj)
let res = this.getGridPositionForEvent(obj)
let
pos = this.getGridPositionForEvent(obj),
fullCell = this.gridDimensions.full.cell,
tempCell = this.mobileTempCell,
moveHandler = this.cellHandler.move,
resizeHandler = this.cellHandler.resize
if (obj.isFirst) {
this.mobileTempCell.show = true
this.mobileTempCell.x = res.x
this.mobileTempCell.y = res.y
tempCell.show = true
tempCell.x = pos.x
tempCell.y = pos.y
}
this.mobileTempCell.width = res.x - this.mobileTempCell.x + 1
this.mobileTempCell.height = res.y - this.mobileTempCell.y + 1
tempCell.width = pos.x - tempCell.x + 1
tempCell.height = pos.y - tempCell.y + 1
if (obj.isFinal) {
this.mobileTempCell.onGrid = true
// this.addMobileCell(obj)
// this.mobileTempCell.show = false
this.cellHandler.move.x = this.gridDimensions.full.cell.width * (this.mobileTempCell.x - 1) + 8 + 20
this.cellHandler.move.y = this.gridDimensions.full.cell.height * (this.mobileTempCell.y - 1) + 8 + 20
this.cellHandler.resize.x = this.gridDimensions.full.cell.width * res.x - 8 - 20
this.cellHandler.resize.y = this.gridDimensions.full.cell.height * res.y - 8 - 20
tempCell.onGrid = true
moveHandler.x = fullCell.width * (tempCell.x - 1) + 8 + 20
moveHandler.y = fullCell.height * (tempCell.y - 1) + 8 + 20
resizeHandler.x = fullCell.width * pos.x - 8 - 20
resizeHandler.y = fullCell.height * pos.y - 8 - 20
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment