Commit 89a5ce37 authored by Christian Hansen's avatar Christian Hansen Committed by Anton Koch

fixed cell manipulation via handler: limited to grid area now (#369)

parent c5ff5131
......@@ -79,6 +79,7 @@
width handler-width
height handler-width
transition opacity ease 350ms
transition-delay 100ms
opacity 0
&.hide
......
......@@ -516,7 +516,9 @@
}
// intersecting
else if (isNaN(_offsetLeft)) {
if (moveHandler.intersectingMainHandler && moveHandler.side === 'right') resizeHandler.intersectingMainHandler = false
if (moveHandler.intersectingMainHandler &&
moveHandler.side === 'right' &&
moveHandler.x > 0) resizeHandler.intersectingMainHandler = false
}
// behind right side
else if (_offsetLeft === 1) {
......@@ -1112,8 +1114,21 @@
const oy = _clientY + this.$el.scrollTop - elContainerBoundingBox.y - offset.y
// const ox = event.clientX + this.$el.scrollLeft - elContainerBoundingBox.x - offset.x
// const oy = event.clientY + this.$el.scrollTop - elContainerBoundingBox.y - offset.y
const x = Math.ceil(ox / this.gridDimensions.full.cell.width)
const y = Math.ceil(oy / this.gridDimensions.full.cell.height)
const { configuration } = this.data
let x
const _x = Math.ceil(ox / this.gridDimensions.full.cell.width)
if (_x <= 0) x = 1
else if (_x > configuration.columns) x = configuration.columns
else x = _x
let y
const _y = Math.ceil(oy / this.gridDimensions.full.cell.height)
if (_y <= 0) y = 1
else if (_y > configuration.rows) y = configuration.rows
else y = _y
console.log(this.cellHandler.move.y)
return { x: x, y: y, ox: ox, oy: oy }
},
updateGridDimensions (size) {
......
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