datastructures-visualization icon indicating copy to clipboard operation
datastructures-visualization copied to clipboard

2-3-4 Tree object not being placed correctly during zoom

Open JMCanning78 opened this issue 3 years ago • 0 comments

The Tree234 object box is placed at the top of the canvas with an arrow linking it to the root 2-3-4 node. When zooming out, the object box becomes separated from the arrow, effectively drifting upwards. Here are figures showing how it used to behave: A 2-3-4 tree with 55 random elements: 09fig08

Zooming out 4 times produces: 09fig09

Changes to the code cause the display to now look like this: Screen Shot 2022-06-06 at 11 39 40 AM

Commit 18dfd98 did not have this problem. You can see the difference by running:

git dt 18dfd98 HEAD Tree234.py

The first thing I notice in that version is the setting of self.ROOT_Y0 = 25 when it used to be 0.

JMCanning78 avatar Jun 06 '22 18:06 JMCanning78