From 2f579995fda91f683bb0c6394da08e524c971382 Mon Sep 17 00:00:00 2001 From: KV Date: Thu, 25 Feb 2021 23:35:15 +0100 Subject: [PATCH] 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. --- src/wireviz/Harness.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index 0efd135..4a2b682 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -95,8 +95,9 @@ class Harness: bgcolor=wv_colors.translate_color(self.options.bgcolor, "HEX"), nodesep='0.33', 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', + width='0', height='0', margin='0', # Actual size of the node is entirely determined by the label. style='filled', fillcolor='white', fontname=self.options.fontname)