Skip to content

Commit 1259800

Browse files
committed
better support for points
1 parent a7c23e0 commit 1259800

File tree

1 file changed

+3
-26
lines changed
  • imagetagger/imagetagger/annotations/static/annotations/js

1 file changed

+3
-26
lines changed

imagetagger/imagetagger/annotations/static/annotations/js/canvas.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,10 @@ class Drawing {
180180
}
181181
}
182182

183-
class Point {
183+
class Point extends Drawing {
184184
constructor(parent, point, id, mutable, color) {
185-
/* Set fields */
186-
this.pointCounter = 1; // The number of points that are currently set
187-
this.id = id;
188-
this.name = "drawing" + id;
189-
this.parent = parent;
190-
this.mutable = mutable;
191-
this.color = color || globals.stdColor;
192-
185+
super(parent, point, id, mutable, color);
186+
this.parent.removeLayer(this.name);
193187
/* Define layer */
194188
let l = {
195189
name: this.name,
@@ -203,23 +197,6 @@ class Point {
203197
this.parent.locked = false;
204198
this.parent.updateAnnotationFields(point);
205199
}
206-
/** Set the cursor to 'drag' or 'crosshair' in mouseover
207-
*
208-
* @param bool whether the dursor is in 'drag' style
209-
*/
210-
setDragCursor(bool) {}
211-
setMutable(mutable) {}
212-
getPointTuples() {
213-
let l = this.parent.getLayer(this.name);
214-
return [[l.x, l.y]];
215-
}
216-
getPoints() {
217-
let l = this.parent.getLayer(this.name);
218-
return {x1: l.x, y1: l.y};
219-
}
220-
remove() {
221-
this.parent.removeLayer(this.name);
222-
}
223200
}
224201

225202
class Line extends Drawing {

0 commit comments

Comments
 (0)