@nmfa wrote:
I am trying to get the cursor to change depending on whether panning or DragSelection is active. However, I can't get the cursor to change until the action is complete and mouseup. This can be seen as the default behaviour with panning, when the four direction cursor appears after the canvas has already been panned for a few seconds. I've tried achieving the same thing with the DragSelection. The cursor argument in box.go.Shape seems to be ignored completely. I've tried overriding both doActivate() and canStart(), but in both cases the cursor does the same as panning, and only appears after the DragSelection is complete.
this.goDiagram.toolManager.dragSelectingTool.canStart = function() { console.log("HERE"); const result = go.DragSelectingTool.prototype.canStart.call(this); if (result) {this.diagram.currentCursor = "crosshair";} return result }or
this.goDiagram.toolManager.dragSelectingTool.doActivate = function() { console.log("HERE"); this.diagram.currentCursor = "crosshair"; go.DragSelectingTool.prototype.doActivate.call(this); }The canStart() behaviour is closest to what I want as HERE is logged on mousedown and the appropriate delay, showing that selection is available, whilst with doActivate() the HERE is only logged once I start dragging the selection. However, in both cases the cursor doesn't change until mouseup.
How can I get the cursor to change before the action occurs?
Chrome, GoJS v.1.8.13, Windows 10
Posts: 6
Participants: 2