render graphs as a single path to avoid killing inkscape

pull/409/head
Lex Neva 2019-04-04 19:57:40 -04:00
rodzic f5f0ce49a8
commit 1f7b69980c
1 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -167,12 +167,16 @@ class Debug(object):
@check_enabled
def log_graph(self, graph, name="Graph", color=None):
self.open_group(name)
d = ""
for edge in graph.edges:
self.log_line(edge[0], edge[1], color=color)
d += "M%s,%s %s,%s" % (edge[0] + edge[1])
self.close_group()
self.log_svg_element(etree.Element("path", {
"d": d,
"style": formatStyle({"stroke": color or "#000000", "stroke-width": "0.3"}),
INKSCAPE_LABEL: name
}))
@contextmanager
def time_this(self, label="code block"):