@@ -240,6 +240,7 @@ export class SkeletonTool {
240
240
} ;
241
241
242
242
let draggingNodeId : number | null | undefined = null ;
243
+ let lastContinouslyPlacedNodeTimestamp : number | null = null ;
243
244
let didDragNode : boolean = false ;
244
245
return {
245
246
leftMouseDown : ( pos : Point2 , plane : OrthoView , _event : MouseEvent , isTouch : boolean ) => {
@@ -266,21 +267,39 @@ export class SkeletonTool {
266
267
} ,
267
268
leftDownMove : (
268
269
delta : Point2 ,
269
- _pos : Point2 ,
270
- _id : string | null | undefined ,
270
+ pos : Point2 ,
271
+ plane : string | null | undefined ,
271
272
event : MouseEvent ,
272
273
) => {
273
- const { annotation } = Store . getState ( ) ;
274
+ const { annotation, userConfiguration } = Store . getState ( ) ;
274
275
const { useLegacyBindings } = Store . getState ( ) . userConfiguration ;
275
276
276
- if (
277
- annotation . skeleton != null &&
278
- ( draggingNodeId != null || ( useLegacyBindings && ( event . ctrlKey || event . metaKey ) ) )
279
- ) {
280
- didDragNode = true ;
281
- SkeletonHandlers . moveNode ( delta . x , delta . y , draggingNodeId , true ) ;
277
+ const { continuousNodeCreation } = userConfiguration ;
278
+
279
+ if ( continuousNodeCreation ) {
280
+ if (
281
+ lastContinouslyPlacedNodeTimestamp &&
282
+ Date . now ( ) - lastContinouslyPlacedNodeTimestamp < 200
283
+ ) {
284
+ return ;
285
+ }
286
+ lastContinouslyPlacedNodeTimestamp = Date . now ( ) ;
287
+
288
+ if ( plane ) {
289
+ const globalPosition = calculateGlobalPos ( Store . getState ( ) , pos ) ;
290
+ // SkeletonHandlers.handleCreateNodeFromEvent(pos, false);
291
+ api . tracing . createNode ( globalPosition , { center : false } ) ;
292
+ }
282
293
} else {
283
- MoveHandlers . handleMovePlane ( delta ) ;
294
+ if (
295
+ annotation . skeleton != null &&
296
+ ( draggingNodeId != null || ( useLegacyBindings && ( event . ctrlKey || event . metaKey ) ) )
297
+ ) {
298
+ didDragNode = true ;
299
+ SkeletonHandlers . moveNode ( delta . x , delta . y , draggingNodeId , true ) ;
300
+ } else {
301
+ MoveHandlers . handleMovePlane ( delta ) ;
302
+ }
284
303
}
285
304
} ,
286
305
leftClick : ( pos : Point2 , plane : OrthoView , event : MouseEvent , isTouch : boolean ) => {
0 commit comments