Commit aa8b0ea4 authored by christianrhansen's avatar christianrhansen

cells aren't positionable outside the grid anymore

parent 3c8ea342
Pipeline #16657 passed with stage
in 6 minutes and 37 seconds
......@@ -395,11 +395,23 @@
async mobileCellMove (annotation, _x, _y) {
let
parsed = annotation.target.selector.parse(),
sliced = parsed.xywh.slice(0, 2),
sliced = parsed.xywh.slice(0, 4),
x = sliced[0],
y = sliced[1]
x += _x
y += _y
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))
annotation.target.selector.value = target.selector.value
await this.$store.dispatch('annotations/patch', [annotation.id, {
......
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