Avoid a node size greater than the HTML label

Bug: When the HTML label is narrow (e.g. connectors in tutorial01),
then the white node background is wider, and when the HTML label is
low (e.g. ferrules in tutorial05 and totorial06), then the white
node background is taller. Such errors are easily seen with a
non-white bgcolor.

Fix: Set node width, height, and margin to zero to let the actual
size of the node be entirely determined by the label.
This commit is contained in:
KV 2021-02-25 23:35:15 +01:00
parent 3223861e17
commit 84772fca91

View File

@ -98,8 +98,9 @@ class Harness:
bgcolor=wv_colors.translate_color(self.options.bgcolor, "HEX"), bgcolor=wv_colors.translate_color(self.options.bgcolor, "HEX"),
nodesep='0.33', nodesep='0.33',
fontname=self.options.fontname) fontname=self.options.fontname)
# Currently, fontname seems to be the only of these node attributes not overridden for each node. # Currently, size and fontname seem to be the only of these node attributes not overridden for each node.
dot.attr('node', shape='record', dot.attr('node', shape='record',
width='0', height='0', margin='0', # Actual size of the node is entirely determined by the label.
style='filled', style='filled',
fillcolor='white', fillcolor='white',
fontname=self.options.fontname) fontname=self.options.fontname)