Avoid transparent cable nodes

Bug: Node attribute fillcolor is ignored unless style contains filled.
When cable nodes get an empty style (unless bundle), the node background
color become equal to the graph background color as it was transparent.

Fix: Make the style contain filled.
This commit is contained in:
KV 2021-02-23 20:56:44 +01:00
parent 22f20e2950
commit 3223861e17

View File

@ -98,6 +98,7 @@ 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.
dot.attr('node', shape='record', dot.attr('node', shape='record',
style='filled', style='filled',
fillcolor='white', fillcolor='white',
@ -337,7 +338,8 @@ class Harness:
html = '\n'.join(html) html = '\n'.join(html)
dot.node(cable.name, label=f'<\n{html}\n>', shape='box', dot.node(cable.name, label=f'<\n{html}\n>', shape='box',
style='filled,dashed' if cable.category == 'bundle' else '', margin='0', fillcolor='white') style='filled,dashed' if cable.category == 'bundle' else 'filled',
margin='0', fillcolor='white')
return dot return dot