Commit fe602358 authored by Tiago Peixoto's avatar Tiago Peixoto

graph_draw(): honor bg_color parameter

parent df4e2faf
Pipeline #696 passed with stage
in 69 minutes and 20 seconds
......@@ -1120,7 +1120,8 @@ def graph_draw(g, pos=None, vprops=None, eprops=None, vorder=None, eorder=None,
scale_ink(ink_scale, vprops, eprops)
return interactive_window(g, pos, vprops, eprops, vorder, eorder,
nodesfirst, geometry=output_size,
fit_view=fit_view, **kwargs)
fit_view=fit_view, bg_color=bg_color,
**kwargs)
else:
adjust_default_sizes(g, output_size, vprops, eprops)
......@@ -1175,6 +1176,8 @@ def graph_draw(g, pos=None, vprops=None, eprops=None, vorder=None, eorder=None,
cr.translate(-x, -y)
if bg_color is not None:
if isinstance(bg_color, str):
bg_color = matplotlib.colors.to_rgba(bg_color)
cr.set_source_rgba(bg_color[0], bg_color[1],
bg_color[2], bg_color[3])
cr.paint()
......
......@@ -286,6 +286,8 @@ class GraphWidget(Gtk.DrawingArea):
self.base_geometry = None
self.background = None
self.bg_color = bg_color if bg_color is not None else [1, 1, 1, 1]
if isinstance(self.bg_color, str):
self.bg_color = matplotlib.colors.to_rgba(self.bg_color)
self.regenerate_generator = None
self.regenerate_max_time = max_render_time
self.max_render_time = max_render_time
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment