summaryrefslogtreecommitdiff
path: root/kicad/dwg.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-20 22:13:59 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-20 22:13:59 -0300
commit66b2c09b0c487009fb2e3abd86764658c129e4ef (patch)
tree15a0ccacbf2c0b245179a2354f0a0145c6e24b64 /kicad/dwg.c
parent04a6cbca7bce3b240c2958b6b6cef69108bcec9b (diff)
downloadeeshow-66b2c09b0c487009fb2e3abd86764658c129e4ef.tar.gz
eeshow-66b2c09b0c487009fb2e3abd86764658c129e4ef.tar.bz2
eeshow-66b2c09b0c487009fb2e3abd86764658c129e4ef.zip
eeshow/kicad/dwg.c (dwg_line): use common direction, to avoid false pixel diffs
Diffstat (limited to 'kicad/dwg.c')
-rw-r--r--kicad/dwg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kicad/dwg.c b/kicad/dwg.c
index 282c1f6..261d0c3 100644
--- a/kicad/dwg.c
+++ b/kicad/dwg.c
@@ -462,11 +462,18 @@ void dwg_noconn(int x, int y)
/*
* We can't use gfx_poly because lines are dashed and we don't have that
* property at the gfx_poly API.
+ *
+ * Since dashing may produce different results between going from A to B and
+ * going from B to A, we enforce a common direction, so that pixel diffs will
+ * treat reversed lines as still equal.
*/
void dwg_line(int sx, int sy, int ex, int ey)
{
- gfx_line(sx, sy, ex, ey, COLOR_SHEET_DWG, LAYER_LINES);
+ if (sx < ex || (sx == ex && sy < ey))
+ gfx_line(sx, sy, ex, ey, COLOR_SHEET_DWG, LAYER_LINES);
+ else
+ gfx_line(ex, ey, sx, sy, COLOR_SHEET_DWG, LAYER_LINES);
}