llimllib / pymag-trees

Code from the article "Drawing Good-looking Trees" in Python Magazine
http://billmill.org/pymag-trees/
Do What The F*ck You Want To Public License
190 stars 33 forks source link

Divided by 0 error #4

Closed ZhaofengWu closed 7 years ago

ZhaofengWu commented 7 years ago

For the N-ary tree drawing algorithm (Buchheim's), in the move_subtree function, there is a line subtrees = wr.number - wl.number. Subsequently, there is a shift / subtrees, which may result in a divided by 0 error, when wr.number == wl.number. How should I cope with this?

ZhaofengWu commented 7 years ago

Sorry, just realized that that case is impossible.