Commit 772e31dd authored by Tiago Peixoto's avatar Tiago Peixoto

graph_draw(): fix bug with drawing a single node

This fixes issue #688
parent 31fafd57
......@@ -1306,7 +1306,11 @@ def fit_to_view(rec, output_size, adjust_aspect=False, pad=.9):
else:
output_size[1] = int(round(float(output_size[0] * h / w)))
zoom = min(output_size[0] / w, output_size[1] / h)
zoom = max(w / output_size[0], h / output_size[1])
if zoom == 0:
zoom = 1
else:
zoom = 1 / zoom
x -= (output_size[0] / zoom - w) / 2
y -= (output_size[1] / zoom - h) / 2
......
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