@@ -180,16 +180,9 @@ class Drawing {
180
180
}
181
181
}
182
182
183
- class Point {
183
+ class Point extends Drawing {
184
184
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 ) ;
193
186
/* Define layer */
194
187
let l = {
195
188
name : this . name ,
@@ -198,28 +191,11 @@ class Point {
198
191
x : point . x1 , y : point . y1 ,
199
192
fillStyle : this . color ,
200
193
} ;
201
- this . parent . addLayer ( l ) ;
194
+ this . parent . setLayer ( l ) ;
202
195
this . parent . inline = false ;
203
196
this . parent . locked = false ;
204
197
this . parent . updateAnnotationFields ( point ) ;
205
198
}
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
- }
223
199
}
224
200
225
201
class Line extends Drawing {
0 commit comments