From fc8e013999cf1ddb784530712bb6cdc5cd59868e Mon Sep 17 00:00:00 2001 From: Adam Mayer Date: Mon, 11 Dec 2017 16:56:47 -0500 Subject: [PATCH] correct centering --- apple410/svg_to_plot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apple410/svg_to_plot.py b/apple410/svg_to_plot.py index 278c44f..fefb016 100755 --- a/apple410/svg_to_plot.py +++ b/apple410/svg_to_plot.py @@ -65,8 +65,10 @@ def plot_svg(f, center=False): s = max(s1,s2) if center: xoff = w/2 - (minx + spanx/2)/s - yoff = w/2 - (miny + spany/2)/s + yoff = h/2 - (miny + spany/2)/s + sys.stderr.write("Centered\n") else: + sys.stderr.write("Not centered\n") xoff = -minx/s yoff = -miny/s segs = map(lambda x: ((x[0][0]/s + xoff,x[0][1]/s + yoff),