From f9140bc53f44dc1c6a051e0fe43b61ca6e53940d Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 26 Jul 2016 18:35:51 -0300 Subject: [PATCH] sch2fig/misc.c (matrix_to_angle, matrix_is_mirrored): 1 0 0 1 and 0 1 -1 0 Tentative support. Untested. --- sch2fig/misc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sch2fig/misc.c b/sch2fig/misc.c index a946edc..820464a 100644 --- a/sch2fig/misc.c +++ b/sch2fig/misc.c @@ -37,6 +37,10 @@ unsigned matrix_to_angle(int m[6]) return 270; if (eq(m, -1, 0, 0, -1)) return 0; + if (eq(m, 1, 0, 0, 1)) /* x-flipped */ + return 180; + if (eq(m, 0, 1, -1, 0)) /* x-flipped, 90 deg */ + return 90; fprintf(stderr, "unrecognized matrix %d %d %d %d\n", m[1], m[2], m[4], m[5]); exit(1); @@ -56,6 +60,10 @@ bool matrix_is_mirrored(int m[6]) if (eq(m, -1, 0, 0, -1)) return 1; + if (eq(m, 1, 0, 0, 1)) + return 1; + if (eq(m, 0, 1, -1, 0)) + return 1; assert(0); }