...
 
Commits (2)
...@@ -629,34 +629,12 @@ ...@@ -629,34 +629,12 @@
let cellType = cell.component let cellType = cell.component
this.selectedCell.type = cellType.substr(4, cellType.length - 4) this.selectedCell.type = cellType.substr(4, cellType.length - 4)
}, },
// async mobileCellMove (annotation, _x, _y) {
async mobileCellMove (annotation, x, y) { async mobileCellMove (annotation, x, y) {
// this.$el.scrollLeft = this.$el.scrollLeft + (this.gridDimensions.full.cell.width * _x) // this.$el.scrollLeft = this.$el.scrollLeft + (this.gridDimensions.full.cell.width * _x)
let let parsed = annotation.target.selector.parse()
parsed = annotation.target.selector.parse()
/*
sliced = parsed.xywh.slice(0, 4),
x = sliced[0],
y = sliced[1],
w = sliced[2],
h = sliced[3]
*/
/*
// ----- x
if (_x === -1) if (x > 1) x += _x
if (_x === 1 && x < this.grid.config.columns - w + 1) x += _x
// ----- y
if (_y === -1) if (y > 1) y += _y
if (_y === 1 && y < this.grid.config.rows - h + 1) y += _y
*/
// x += _x
// y += _y
let target = this.grid.get2DArea([x, y], parsed.xywh.slice(2)) let target = this.grid.get2DArea([x, y], parsed.xywh.slice(2))
annotation.target.selector.value = target.selector.value annotation.target.selector.value = target.selector.value
await this.$store.dispatch('annotations/patch', [annotation.id, { await this.$store.dispatch('annotations/patch', [annotation.id, {
target: { target: {
...@@ -667,20 +645,9 @@ ...@@ -667,20 +645,9 @@
async mobileCellResize (annotation, _w, _h) { async mobileCellResize (annotation, _w, _h) {
let let
parsed = annotation.target.selector.parse(), parsed = annotation.target.selector.parse(),
[x, y, w, h] = parsed.xywh sliced = parsed.xywh.slice(0, 4),
console.log('mobileCellResize', w, h) x = sliced[0],
/* y = sliced[1]
// ----- w
if (_w === -1) if (w > 1) w += _w
if (_w === 1 && x < this.grid.config.columns - w + 1) w += _w
// ----- h
if (_h === -1) if (h > 1) h += _h
if (_h === 1 && y < this.grid.config.rows - h + 1) h += _h
*/
// w += _w
// h += _h
const value = { xywh: [x, y, _w, _h] } const value = { xywh: [x, y, _w, _h] }
annotation.target.selector.value = value annotation.target.selector.value = value
......