I am trying to draw a line using the mouse, in order to do so I am using a go:Node with a canvas as its contents and then using the LastMousePointInModel method to determine where in the model the mouse currently is and setting the start / end points of a line within the canvas.
This works fine most of the time when the node is within the current view port of the diagram.
It also works if the diagram has been zoomed and the node is outside the view port.
The process falls down when the diagram has been zoomed and panned and the node is outside the current view port.
To try and resolve this I have tried,
Point currentPos = diagram.LastMousePointInModel;
This sets the Node.Location but does not set the position, leaving it outside the view port and the line I am trying to draw does not appear.
I have also tried setting the Node.Position directly, but again this does not move the position (but does set the location).
If the node is in the current view or the diagram has only been zoomed, both of the above methods work.
Is there a way to move a node into the viewport (without changing the viewport). Or is there a better way to draw a line on the diagram using model coordinates. The line is used to define a scale on the diagram so must be in model coordinates.