From 921cfe9cd1c9329814814b842566278b5c9b1b48 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 26 Dec 2013 08:06:03 +0000 Subject: [PATCH] Slight simplification to whitepixel(). Previously, when two black corners of a white pixel were adjacent, they were both modified so as not to overlap. Now only one corner is modified, albeit slightly more radically. This has no practical effect on the output, but it makes the code simpler. --- bedstead.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/bedstead.c b/bedstead.c index 747544c..0a4e569 100644 --- a/bedstead.c +++ b/bedstead.c @@ -1500,34 +1500,26 @@ whitepixel(int x, int y, int bl, int br, int tr, int tl) x *= 4; y *= 4; if (bl) { - moveto(x, y); - if (tl) { lineto(x, y+2); lineto(x+1, y+2); } - else lineto(x, y+3); - if (br) { lineto(x+2, y+1); lineto(x+2, y); } + moveto(x, y); lineto(x, y+3); + if (br) { lineto(x+2, y+1); lineto(x+1, y); } else lineto(x+3, y); closepath(); } if (tl) { - moveto(x, y+4); - if (tr) { lineto(x+2, y+4); lineto(x+2, y+3); } - else lineto(x+3, y+4); - if (bl) { lineto(x+1, y+2); lineto(x, y+2); } + moveto(x, y+4); lineto(x+3, y+4); + if (bl) { lineto(x+1, y+2); lineto(x, y+3); } else lineto(x, y+1); closepath(); } if (tr) { - moveto(x+4, y+4); - if (br) { lineto(x+4, y+2); lineto(x+3, y+2); } - else lineto(x+4, y+1); - if (tl) { lineto(x+2, y+3); lineto(x+2, y+4); } + moveto(x+4, y+4); lineto(x+4, y+1); + if (tl) { lineto(x+2, y+3); lineto(x+3, y+4); } else lineto(x+1, y+4); closepath(); } if (br) { - moveto(x+4, y); - if (bl) { lineto(x+2, y); lineto(x+2, y+1); } - else lineto(x+1, y); - if (tr) { lineto(x+3, y+2); lineto(x+4, y+2); } + moveto(x+4, y); lineto(x+1, y); + if (tr) { lineto(x+3, y+2); lineto(x+4, y+1); } else lineto(x+4, y+3); closepath(); } -- 2.30.2