1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-18 01:04:05 +02:00

eeshow/kicad/delta.c (comp_eq_objs): we never properly compared lib_obj_poly

This commit is contained in:
Werner Almesberger 2016-08-20 20:57:54 -03:00
parent 0d2b024d9c
commit 27065ad42f

View File

@ -38,6 +38,8 @@
static bool comp_eq_objs(const struct lib_obj *a, const struct lib_obj *b) static bool comp_eq_objs(const struct lib_obj *a, const struct lib_obj *b)
{ {
int i;
/* /*
* @@@ over-simplify a little. We don't search to find objects that * @@@ over-simplify a little. We don't search to find objects that
* have merely been reordered. * have merely been reordered.
@ -49,6 +51,16 @@ static bool comp_eq_objs(const struct lib_obj *a, const struct lib_obj *b)
return 0; return 0;
switch (a->type) { switch (a->type) {
case lib_obj_poly: case lib_obj_poly:
if (a->u.poly.thick != b->u.poly.thick &&
a->u.poly.fill != b->u.poly.fill)
return 0;
if (a->u.poly.points != b->u.poly.points)
return 0;
for (i = 0; i != a->u.poly.points; i++)
if (a->u.poly.x[i] != b->u.poly.x[i] ||
a->u.poly.y[i] != b->u.poly.y[i])
return 0;
return 1;
case lib_obj_rect: case lib_obj_rect:
return a->u.rect.sx == b->u.rect.sx && return a->u.rect.sx == b->u.rect.sx &&
a->u.rect.ex == a->u.rect.ey && a->u.rect.ex == a->u.rect.ey &&