This method uses signaling (through a boolean) and I feel like it's
extremely hacky, but I tested this and it (kind of?) works.
Unfortunately I found this to potentially lag when resizing.
I am not sure if this is guaranteed to work (as in, produce correct
behaviour) or not, but to my understanding only LogicDialog uses LCanvas
(grep out "LCanvas\|canvas" and see) so it will most likely work?
I tested this and accidentally found an unrelated issue related to
LCanvas.maxJumpsDrawn, but I hope this will be fixed in the near future.
Note that this is very incomplete, for two different reasons:
- it's O(n^2) or potentially worse
- it makes the GC work hard (it invokes `new` in
`LCanvas.DragLayout.layout()`)
For the second reason this does not clearly fit the criteria of
CONTRIBUTING.md, but I have yet to figure out ways to work around this
(or make the algorithm more efficient).
Original canvas.jumps is now a reference to canvas.statements.jumps.
Please remove canvas.jumps in favour of canvas.statements.jumps in a
future release. Thanks!