FePhyFoFum / otu

nexson / git interactions
0 stars 0 forks source link

Draw text boxes on tree view using bounding box for text #9

Open chinchliff opened 10 years ago

chinchliff commented 10 years ago

Currently the width of the rects for the otu labels on tree view is calculated from the number of characters in the name. But we are not using a fixed-width font so the actual dimensions of words containing the same number of characters vary. We compensate by making the boxes wider than they need to be for many words so that they are always (hopefully) wide enough for any word. There should be a way to select the text element of each node and get its bounding box so we can set the rects to that.

Alternatively, we could color the background of the text elements, but I haven't been able to get this to work.