1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-25 23:35:55 +02:00

eeshow/kicad/dwg.c (dwg_line): use common direction, to avoid false pixel diffs

This commit is contained in:
Werner Almesberger 2016-08-20 22:13:59 -03:00
parent d4b06ff3da
commit c42fe2f5a2

View File

@ -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)
{
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);
}