From 1259800c7c018229c8dc2e84d58c8dccb9d852ac Mon Sep 17 00:00:00 2001 From: Timon Engelke Date: Tue, 6 Apr 2021 12:34:42 +0200 Subject: [PATCH] better support for points --- .../static/annotations/js/canvas.js | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/imagetagger/imagetagger/annotations/static/annotations/js/canvas.js b/imagetagger/imagetagger/annotations/static/annotations/js/canvas.js index 31041543..06538ba3 100644 --- a/imagetagger/imagetagger/annotations/static/annotations/js/canvas.js +++ b/imagetagger/imagetagger/annotations/static/annotations/js/canvas.js @@ -180,16 +180,10 @@ class Drawing { } } -class Point { +class Point extends Drawing { constructor(parent, point, id, mutable, color) { - /* Set fields */ - this.pointCounter = 1; // The number of points that are currently set - this.id = id; - this.name = "drawing" + id; - this.parent = parent; - this.mutable = mutable; - this.color = color || globals.stdColor; - + super(parent, point, id, mutable, color); + this.parent.removeLayer(this.name); /* Define layer */ let l = { name: this.name, @@ -203,23 +197,6 @@ class Point { this.parent.locked = false; this.parent.updateAnnotationFields(point); } - /** Set the cursor to 'drag' or 'crosshair' in mouseover - * - * @param bool whether the dursor is in 'drag' style - */ - setDragCursor(bool) {} - setMutable(mutable) {} - getPointTuples() { - let l = this.parent.getLayer(this.name); - return [[l.x, l.y]]; - } - getPoints() { - let l = this.parent.getLayer(this.name); - return {x1: l.x, y1: l.y}; - } - remove() { - this.parent.removeLayer(this.name); - } } class Line extends Drawing {