uid / snapdown

Draw snapshot diagrams with plain text
MIT License
3 stars 0 forks source link

Stack frames: Better edge routing #30

Closed dwhatley19 closed 3 years ago

dwhatley19 commented 3 years ago

http://web.mit.edu/dwhatley/www/snapdown/web/production.html#%231%20-%3E%206%0Amain()%20%7Ba%20-%3E%20%231%7D%0Amain2()%20%7Ba%20-%3E%20%231%7D

Current result: image

This edge looks very messy; one approach would be to use the "smoothen path" option, but doing so sometimes leads to the following bug(?) in PathFinding.js:

image

Easy repro: turn path-smoothening on, and use the following diagram:

x -> (Whatever)

topOfStack() {
// NOT SUPPORTED YET
this -> x
foo -> 5
}
lowerInStack() {}
main() {}
dwhatley19 commented 3 years ago

Edge routing is now smoothened successfully, however, take note of this sed command used as a precompile hook to fix the above bug. https://github.com/uid/snapdown/blob/main/precompile-hook.sh

Closing this issue for now.